how to get a userIds or users associated with particular assets category - liferay

If I create a new category it will store in AssestCategory table.At the same time entry should be in AssestEntry table also.For mapping between these two tables we have AssestEntries_AssestCategories table.How to achieve above thing by programmatically because for mapping table I didn't get any API.by these tables shall I get userIds associated with particular category. Or let me know is there any other way.

A new entry stored in AssetCategory when a category is created for a topic in site.
For example, Create a category named "Test Category" in site. You will see an entry in AssetCategory table. But there will not be any entry get stored to AssetEntries_AssetCategories table.
When the category is associated with some data item, then its association is stored in AssetEntries_AssetCategories table.
For example, When you create a bookmark with "Test Category" selected, then a new entry stores in AssetEntries_AssetCategories table.
entryId in AssetEntries_AssetCategories represents the corresponding entry for AssetEntry table.
In liferay Asset framework, liferay-ui:asset-categories-selector tag can be used to provide Asset category selection.
Please refer below links for details of liferay asset framework and to implement the same for a custom resource.
https://www.liferay.com/en_GB/documentation/liferay-portal/6.2/development/-/ai/asset-framework-liferay-portal-6-2-dev-guide-06-en
https://dev.liferay.com/develop/learning-paths/-/knowledge_base/6-2/enabling-assets-at-the-service-layer

Related

Is there a way to connect a contact's category to their roles?

I am setting up a company for lead nurturing and marketing automation and I'm in the process of scrubbing up all of the contacts, customers, and leads. The way that we are using NetSuite right now, we don't have any need for a separate contact category and role.
So I want to set up a script to connect the category and role fields, or have the role field always copy what's in the category field.
Is there any way to achieve this?
The "Contact Category" and "Contact Role" fields in NetSuite are two different CRM list fields. Which means that:
In order to create a new "Contact Category", navigate to: Setup -->
Sales --> CRM Lists --> New --> Contact Category
And In order to create a new "Contact Role", navigate to: Setup -->
Sales --> CRM Lists --> New --> Contact Role
And because they are two different list fields, you need to have a 1 to 1 link of both these list values before populating it in your entity record.
One efficient way to do it would be by using a custom record as a reference. Please follow the below procedure to achieve the same:
Create a "Custom Record" titled "Contact Category & Roles" [or any appropriate name] with two fields in it: Contact Category (list/record of contact category) and Contact Role (list/record of contact role)
Now create each of these "Contact Category & Roles" custom record. For every record, select the Contact Category and the corresponding Contact Role.
Hence, in this way you will now have a list of this custom record that gives the Contact Category and its corresponding Contact Role.
This custom record can now be used as a reference in scripts.
For new records that are created, have a client script deployed. And in the "fieldChanged()" event of the script, write the logic to populate the role field based on what the category field is selected. [So here, when the category field is selected, reference the custom record and see if the category field has a corresponding role value and set it accordingly]
And since you are doing a scrub of already existing records, you can achieve the same by writing the above logic (point 5) in a schedule or map/reduce script (i.e by loading each record, getting the category value, referencing the custom record and getting the corresponding role and setting the role value).
Additional Note: If the Category values need to be cleaned up, a csv import could be done to achieve the same. You can then run the schedule script to set the role values.

NetSuite: How do you delete products from a category?

Rookie NS question. I've got 1,000+ products in a category. I just created sub-categories and segmented the products better, so now all I want to do is remove the 1,000 products from the root category. How do I do that without having to do it one-at-a-time? Do I need to do a mass update?
If i'm understanding you correctly, you've already added the products to their respective sub-categories and there's just unwanted copies of the bulk of them in the root category. Usually you'd have to delete them manually.
A shortcut:
Make a temporary category
Put the subcategories under that temp category
Delete the root category. Deleting a root category will delete it's subcategories, so this is why your subcategories need to be under a different category before deleting the root.
Recreate the root category and it'll be a clean slate for you to work with. You can then simply add the subcategories back to it and delete the temp category.
I had a similar circumstance. I simply did a CSV update for Import Type: Website and Record Type: Site Category.
My CSV file had two columns, one for the internal id of the web category and one item with the value of the internal id of the item (Any random item).
Simply do the import, as an update, but the real trick is to select Update and Advanced Options below OVERWRITE SUBLISTS (tick).
In the field matching you map the internal id of the Site Category to the internal id field.
In the Site Category Presentation Items below, expand out and map the internal id of the item to item, ensuring you select internal id as the mapping option if you are in fact using this (option of Names are of course fine but I prefer always to use the Internal ID option which never changes).
Lastly select Type field for mapping and choose Item as a Default.
Example of this mapping below.
Category internal id maps to Site Category : Internal ID
Item internal id maps to Site Category Presentation Items 1 : Item
Item maps to Site Category Presentation Items 1 : Type
With the overwrite sublist selected, all the items will be removed and you will end up with just the one item in the Web Category, which you can then quickly delete if you want it completely empty.

SharePoint 2010: How do you reference the "Name" field when creating a lookup to a document library based on a document set?

I'm modifying the properties form of a SharePoint list that requires the user to select one or more items via a lookup to a document set. The document set library has a "Name" field which I cannot select as a field in my form's lookup properties.
The document set, of course, is a collection of documents grouped together with a common name, workflows, and metadata. The "name" I'm trying to display in my lookup list is set by the end user, but is inaccessible to me. Ideally, when someone is viewing an item in my SharePoint list (the one I'm trying to link from) and they see an associated document set item, they would be able to click on the name and it will take them to that element within the document set.
Any ideas?
Okay, I got around this issue by creating a new workflow that fires any time a record is modified. This workflow sets a new text field to the value in the Name field. To apply this to existing records, I created a new checkbox field named "Fire Workflow", then went to the Datasheet view and checked that checkbox for all of the records. This forced the workflow to fire on each record and update the new text field.
Now I just reference this new text field for the lookup in my other library. All is good!

Create custom view with multiple entities in CRM 2011?

I'm new in CRM 2011. So not familiar with all it functionality.
Have a question about displaying data from multiple related entities.
First Entity is a Users (contain information about user)
Second Entity is a Class (contain information about class user enrolled)
Third Entity is a Class Attendance (contain information if user attended class on specific date)
The idea is to show view with users who is enrolled in class.
To show start end dates and if user attended class or not.
Administrator should select user and change status to attended or not.
How it can be done in CRM 2011? Is it required custom development or just to View Customization using user interface in CRM?
Any suggestion or examples highly appreciated.
In Mscrm you can create a view for a single primary record type, on this view you can show fields from the primary record. You can also include secondary records that are linked via a lookup to the primary record, you can show columns of these secondary linked records. The limitation here is that you cannot link tertiary records from these secondary linked entities. The slight confusion here is that you can show the name of the tertiary entity as its a field on the secondary entity.
So to put this into the context for a real example, take the following entity model.
Contact has a 1 to Many relationship with incident (a contact can have many incidents, each incident has a lookup to contact)
Incident has a 1 to Many relationship with task (an incident can have many tasks, each task has a lookup to an incident)
So a view of tasks can;
Show all the fields from the task (task in the primary)
Show all the fields from the incident (incident is the secondary)
Show the name of a the contact, but not any other field (contact is a tertiary, but its name is shown as a field from the incident)
This is one of those things that becomes a lot clearer when you actually try it out for yourself. Its hard to say what you will be able to achieve because its not clear what your entity model is.
In any case here is how you create your own custom view.
CRM > Settings > Solutions > Your Solution > Your Entity > Views > New. There are various buttons would should hopefully be self explanatory.
Click Add Columns and it will present you with fields of the primary entity, use the Record Type drop down option to select fields from linked secondary entities.
Reading between the lines you have:
Class entity with many:many relationship to student (user), so a user can be enrolled on more than one class and a class has more than one user.
There is then a second entity for attendance which by the sound of it has a many:1 relationship to both student and class, and has a status to show attendance for a particular instance of the class on one date.
So far sounds like a good model.
Using the ideas in James' answer you ought to be doing a view of Attendances, including the name of the class and user. You might also have extra columns from the user or class to show things like when the course starts and ends, what the student's email address is etc.
Sort this view by class, then student, then attendance date and you have a pretty good view. But this won't display in any kind of hierarchy or show summaries. You might want to look at building a custom report for this instead so you can report on attendances, grouped by student and grouped by class. If you get clever you could also add filters for dates so you can look at attendances last month only, for example. You can probably do a lot of this with the built-in report wizard, for more complex or pretty versions go to SSRS

Dynamics CRM 2011: Extended lookup for a field in "Create New" form

I have the following scenario:
A user wants to create a new record of entity CustomEntity1. One of the fields on the "Create New" form is a reference to the entity of type CustomEntity2.
Now, there is a built in lookup where thety can search by name, or filter the options to a predefined view. This doesn't help, because the user needs to get the name (or names) of CustomEntity2 which satisfies a set of criteria based on the fields in CustomEntity2.
Is there a way to incorporate this in "Create New" form for CustomEntity1?
And the question again, a bit less abstract:
The user needs to create a new record of type CustomerAccount. In doing this he/she needs to fill a field called Group. This should be looked up in a list of existing groups, based on several criteria - Type, Region, Budget and so on. Is there a way for the user to enter this criteria while creating the new record, and not go separately to the list of Groups and run a report to find the candidates?
You can use the addCustomView method of the lookup control to filter the options based on the fetchXML and layoutXML that you provide.
One way to supply the right conditions to your custom fetchXML is to duplicate the Type, Region, and Budget fields in the CustomerAccount form, so that when the lookup dialog is opened, it filters the existing Groups based on the values you've selected in the CustomerAccount form.

Resources