Add picklist custom field to Entity in Dynamics CRM - dynamics-crm

In the Dynamics CRM environment, I have created the custom entity as Countries. there is another by default entity under the Sales is: Opportunity. I create the N to N relationship between both (Opportunity and countries).
Then when I go to opportunity editing page that is opportunity entity under the edit mode.I added the new field name as Select Country (following map : Settings-> Customizations-> Opportunity -> Forms and Views -> Form-> double click->Add Field). Got the field list. I found my custom field in the list. I select it. But I found it is of type lookup. where as I want to that should be picklist.
How to get picklist field of my custom entity field?

1:N relationships will always show up in CRM as lookups. N:N relationships will show as a separate grid on the left navigation of an entity. Without custom code, you can't get your lookup to appear as a picklist.

Related

Add a sub grid and view for field update

I have added a field to the Contact entity called Website Downloads. This field is updated every time a client clicks on our website but what I want to do is have a sub grid within the Contact form that shows what this entry is each time it's updated. Then I ideally need this in a view with the contacts name and a list of the downloads so I can do an advanced find on the field. Any ideas please. PS I have tried to add a new entity that links to this field but the problem is you cannot do an OR on an Advanced find for 2 separate entities so back to square one.
Already tried a new entity but this won't work as you cannot do an OR on an Advanced Find for 2 entities.
I think you are on right track. You need a related entity to capture all the website hits, then you need a rollup field on contact record to sum up the hits.
So the associated records can be listed in a subgrid on contact form, also Advanced find queries can be done.
Rollup field can be an OOB field but it has timely job to calculate, if you want immediate rollup result it can be a custom field & plugin to accumulate.

CRM 2016 - How to create a parent-child relationship with multiple parent types?

I have an entity - EntityZ, which has a ParentId where ParentId could be EntityA.Id, EntityB.Id or EntityC.Id. Is it possible to create this in MS Dynamics CRM 2016? If yes, how? I've looked but couldn't find a similar question or any help on the web.
An entity can be the child party in only one full parental relationship. When you are looking for a way to cascade record ownership, deletion a.o. between mutiple parent - child entities you can create configurable cascading relationships.
As Arun Vinoth pointed out you can design your entity as an activity type. However, this may conflict with the semantics of activity records in CRM. Also, doing this would make it possible to associate the child entity to any entity that is enabled for activities.
There’s a trade off to achieve this. Custom entity as Custom Activity
Creating custom entity EntityZ as custom activity and EntityA, B, C can act as parent.
EntityA or B or C can be chosen as RegardingObjectId of EntityZ.
This has security limitation like EntityZ will be visible to everyone as this will be listed like other activities (Email, Phonecall, Task, etc)
I think it is worth nothing that Dynamics 365 does contain and out-of-box "polymorphic" customer field.
This field can link to either an Account or Contact:
And while it can be kludgy, another option would be to create 3 lookups and only populate one. Once one is populated you could hide the other two. Or, you could have a "Parent Type" option set to determine which lookup to show.
It would be a bit messy to show three lookups in a view, with only one populated, so you might also want a Parent Name text field in to which you could concatenate the type and name. You could use a workflow to populate it, and then use it in views and reports.

Fetch value of a field from one entity to second entity based on the lookup field selected in second entity using Fetch XML

I am new to CRM. I have a requirement where I have an "account" entity and a "contact" entity. In contact form I have a lookup field for searching account name which is stored in account entity. When I select an organization through lookup, the contact number of that organization should be fetched and saved in another field in contact form. I need to do it with fetch XML.
Option 1: You can do a no-code solution by mapping fields between account & contact.
Option 2: If you don't want a physical copy of field value in both entity, use Quick view form of Account lookup to just display the fields in contact without storing redundant data.
Option 3: If you still want to store the value onchange of account, retrieve it & set it in contact field. This step by step guide will help you to build fetchxml & use it in JS. Your question doesn't say if you are stuck in query or any error.

CRM 4 - Add Account specific field to Opportunity

My Account entity has an Account Manager field. I would like to add this same field to Opportunity as a reference. Is there a way to add this field to Opportunity and make it point to the attribute "Account.Account Manager"?
I am using MS Dynamics CRM 4
What you're asking for is copying the field "Account Manager" in entity "Account" to entity "Opportunity", is it?
If that is what you want, you need to create a field named "Account Manager" (or whatever you wish to) in the "Opportunity" entity form; the field type being the same. And you need to have some kind of workflow/plugin/javascript to update the field in "Opportunity" form with the same value as present in the "Account" form.
EDIT: Based on your comment, I've edited the answer. You can achieve it by two means:
Have some kind of workflow/plugin populating the field in
Opportunity form from that of the Account form.
Fetch the value of the Account field by javascript on Opportunity
form load and display it in a field.
Also, you might want to make the field read-only in Opportunity form.

CRM 2011 lookup attribute mapping

Is it possible to set null/blank lookup values on relationships in CRM 2011 when they open from the parental/referrential entity?
Example, if you create a new 1:N relationship between the entities opportunity and account holding an agency value. When creating a new opportunity from an account, this account is prefilled in both the potential customer lookup field and the agency lookup field.
This can easily be remedied with a javscript, clearing the field onload, but can this be done earlier, in the attribute mapping, or is it always a post-fix to correct the default action?
I had the same issue in Crm 4. So I suppose it still exists in 2011.
You cannot remove the relationship mapping of the primary attribute, though I've never understood why this automatically maps to fields of different relationships.
In this case you are just best off using JavaScript to perform the following logic:
If the form is in create mode and both fields contain the same value then clear the duplicated field.
This logic should ensure that it only clears the fields in this circumstance.
This is not possible without Javascript.
MS CRM doesn't give you an option to counter the autofill of the mapped field. It will always be automatically filled in by the system.

Resources