CRM 4 - Add Account specific field to Opportunity - dynamics-crm

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.

Related

How to populate look up field based on text field - Dynamics 365

I am trying to populate contact field (Potential Customer) based on text field (Email Address) set. To bear in mind, it should be unique based on the customer record.
Condition is if Email address field is set, look up field (Potential Customer) value should be fetched based on the Email address field.
Wherever you are trying to fill that contact lookup from (plugin, form script, console job, web app, ETL, MS Flow, etc), you have to fetch the contact by filtering the email value and set it in lookup entity reference.
You can use web api or fetchxml to achieve that. Here is how it should look like.
https://crmdev.crm.dynamics.com/api/data/v9.0/contacts?$select=fullname&$filter=emailaddress1 eq 'test#gmail.com'
C# example
Javascript example
Once you fetch the lookup field based on email address using web api which is suggested by Arun. To set lookup field on form using javascript see below article.
https://xrmdynamicscrm.wordpress.com/2020/06/17/dynamics-crm-365-set-lookup-regarding-field-while-using-xrm-navigation-openform-formparameters/
Please mark my answer verified if i were helpful

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.

Link Lookup Table to Account Name Field

In CRM Online I need to link the Account Name field in the Account entity to a lookup table of imported and approved company names. The goal is to require users to pick from an approved list instead of letting them make up a company account name. I know there is an Account Name lookup in Contacts which uses existing Account Name records, but I need the lookup in the Account entity. Thanks for any tips.
If you are referring to a different entity as LookupTable, then create a relationship between Account ans the Lookup Table entity. After that you can use that entity as Lookup attribute in Account entity
CRM renders a Lookup control for a 1:N relationship. What you are trying achieve would fall more into a data validation scenario where users can enter account names from a pre-set list of names.
You can leverage a new event introduced in CRM 2016 - addOnKeyPress which can be easily used to build an autocomplete feature which would be more inline with what you are trying to achieve. If a user doesn't "pick" a value instead types anything in disregarding the autocomplete use attribute control's setNotification to set an error message which would invalidate the save preventing the user from saving the record.

Pulling data from one entity onto an Email form within a Workflow

I have a workflow that will fire once a form field changes. The workflow checks the value and then sends an email if one particular value is selected. That much I've managed to figure out.
Now I need to pull a field value from a separate entity to populate the "to" field of the email. We have a Configuration entity that stores the value of a distribution list - we want to pull this into the email that the workflow generates.
I've created an N<>1 relationship between the primary entity and the Configuration entity, however I only see the Entity and not the entity's Fields in the email form assistant. Any idea how I can pull that data onto the email form?
If you see the entity populated under "Look for" and then in the drop down under that you see no values? I'm guessing in your configuration entity your email address you want to use for the email recipient is a text field. In order for the form assistant to populate the second drop down, the field types must match up - or in this case for a field to show up as useable for the "To" field, it needs to be an Account, Contact, User, etc... values you can send an email to.
My suggestion is create a Contact record that has the proper email address and either relate that to your base entity in place of your configuration entity (if possible) or relate your configuration entity to Contact and populate the new lookup on the configuration entity accordingly.

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