Create custom view with multiple entities in CRM 2011? - dynamics-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

Related

In Acumatica, using #me inside Relations Section of Generic Inquiry

We want to have a sales order dashboard where we only show orders for certain sales people based on the logged in user. For example, we have sales people BB and CR who share an assistant TP. BB can see his orders on the dashboard. CR can see his orders on the dashboard. TP can see orders for both of them on his dashboard. We also have people outside of sales who need to see all orders. We want to do all of this without having to create a bunch of custom dashboards. We wanted to maintain 2 dashboards - one filtered one for sales people and one unfiltered one for everyone else.
We have gotten close to solution by using a generic inquiry. We created custom fields on the salesperson that point back to a logged in user (UserID1 and UserID2). Multiple custom fields were used because a single sales person could be visible to 2 people. We then joined SOOrder to SalesPerson inside our GI. We then wanted to join the Users table on (SalesPerson.UserID1 = Users.PKID AND SalesPerson.UserID1 = #me) OR (SalesPerson.UserID2 = Users.PKID AND SalesPerson.UserID2 = #me). That would allow us to create a filter where Users.PKID is not null to limit the view for sales people and then not use any filter on the non-sales dashboard.
The problem is that #me is not available on the Relations section. It is only available on the conditions section. We tried to just have the join of SalesPerson.UserID1 = Users.PKID or SalesPerson.UserID2 = Users.PKID and then creating the condition for the #me portion. The issue there is that it only shows records with a match. That won't work for non-sales people.
Is there some way to include #me or an equivalent on the relations tab? Any better way to accomplish this?
Built-in variables like '#me' aren't well documented which raises questions about support of this feature.
Try this instead:
In generic inquiry TABLES tab, add table 'PX.Data.AccessInfo'.
In PARAMETERS tab, add a new parameter (ex: 'P1') and set the Schema Field value to 'Accessinfo.UserID' (use 'Accessinfo' or the alias for that table declared in TABLES tab).
In the RELATIONS tab in the join condition Child Field you can reference the '[P1]' variable.
Accessinfo DAC contains current record of the logged in user and reflects the information you see when you click your profile in the top right of Acumatica pages. If the solution doesn't work right away you can debug it with the Request Profiler page to look up the generated SQL query for the GI.

Handling Record List operations

I have a requirement where I need to maintain records of data in database table via SharePoint, provide powerapp or other solution based interface so that I could do the following+
Add, Update or Edit the Package records.
Pick desired records and create Parent to group them.
I heard that above mentioned grouping desired records ( building parent child ) relation is not supported in SharePoint either OOTB or Custom approach?
Request suggestion or direction that could be taken, if anyone has done something similiar.
You can't directly create parent-child relationships in sharepoint, what you can do is work around the IDs. Let's say you want to create a database of books... Every book has an author, and you want to store the data of the author as well.
You can create a table for authors, and a table for books. Each author you add to the list will have a name, surname, email, etc, and an unique Author ID.
Now you want to add a book for that author. In the book table you would give the book an ID, name, published date, etc, and instead of the name of the author, you would give it the ID of the author referencing the author data in the other table. If you want the author's name (for instance), all you need to do is search in the Author's table for that author ID.
This has been my workaround when doing parent-child tables in Sharepoint. Hope this makes sense to you. Best regards

How to import a contact with a relationship to another contact?

I'm importing data from another system to Dynamics CRM.
My source data is a table of people, some of whom have a one way relationship to another person. This is represented by a field in the table that contains the id of the other person.
I want to import these people into CRM as contacts, with a relationship to the other contact.
However, I don't think this will work because when a contact is imported the other person might not have been imported yet and so my calculated column lookup won't necessarily find the id of the other contact.
Can you think of a way to make this work?
(I am using Simego Data Synchronisation Studio for this. http://www.simego.com/Solutions/CRM-Integration)
Can you set the tool to do an import and then an update? The first time through, don't load the relationship fields at all, just load all of the contacts. The second pass through, you shouldn't be creating any contact, just setting this relationship field.

Finding Lookup item numerical values in MS Dynamics

I have a site powered by ExpressionEngine 2.5.x, using Freeform, integrated to post form data to MS Dynamics CRM 2011. The extension is nicely scalable, I can change the mapping, all that excellent stuff. My problem is how to find mapping values for Lookup fields in MS Dynamics.
I am trying to map form fields from the site forms, into MS Dynamics. Some of the fields are Lookups, in MS Dynamics. Our mapping calls out the numerical value of the Lookup item, rather than its name. (Which is good, because ppl can change the text names in the MS Dynamics console without breaking the mapping.)
My question is: I know how to find the actual back-end field names of form fields within MS Dynamics. But how to I find the numerical values of the picklist items and lookup fields? Say I have a Lookup field, for Lead Source (called campaignid). The items are:
web
online
radio ad
flyer
word of mouth
other
I know that when I edit options in an option set, I can see their numerical value. Where can I edit options in a lookup field? I've tried looking under Settings > Customizations > Customize the System, but didn't see anything called lookup.
Lookups are pointers to entities. They do not have numerical values like regular option sets. So I guess that you will have entity called Campaign (or lead) so you can check which campaigns exist in the crm DB where each entity will have view in the DB.
Let's see if i understand your question. You don't have a Lookup option like Option Set because a lookup is consequence of a relationship 1:N between two entities. So for edit a lookup you need edit a record of a entity. In lookup fields you don't have numerical values, you have guid that represent individually a record, so in a record a lookup is stored in database as a guid. Check this video.
Check here how find this guid with the record open.
A look-up field is, roughly speaking a pointer to en entity (in C# it's referred to as EntityReference instead of Entity) and it consist mainly of a guid and logical name of something.
Usually, in the code, when you have an entity, in order to access the fields of its lookup-connected entity, you'll need to make an extra query for that.
So, if you have a Contact instance and need to see the address of its parent customer, you'll have to get the guid and logical name (in this case it'll be Account) and retrieve the data for it separately.
EDIT:
Suppose that you have created an instance of Contact entity and you'd like to access its lastName field. Then you can simply refer to it as follows.
var value = Xrm.Page.getAttribute(“lastName”).getValue();
On the same form, there's also a field that refers to an Account instance (its name is parentCustomerId. Suppose now that you'd like to get the fullName field of the Account. One could expect the following to work.
var account = Xrm.Page.getAttribute("parentCusomterId").getValue();
var name = account.getAttribute("fullName").getValue();
However, that's not going to work, because the parentCutomerId is a look-up field. It means that it only contains a guid (a pointer, a reference) identifying an other entity. You'll have to use it (the guid) in order to fetch the instance that the look-up is "mentioning". Then you'll be able to check it's properties.

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