Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Bengaluru or Bangalore Dynamics 365 User Grup ...

Bengaluru or Bangalore Dynamics 365 User Grup

(0) ShareShare
ReportReport
Posted on by 20

Hi,

I am trying to get and set the lookup on create of account create contact with same lookup values, all the fields are getting mapped except the lookup field values. Kindly find the below mentioned code and correct me if my code is wrong.

Entity Account = (Entity)context.InputParameters["Target"];
EntityReference ContactLookup = Account.GetAttributeValue<EntityReference>("new_contactlookup");
var LookupId = ContactLookup.Id;
var logicalName = ContactLookup.LogicalName;

Entity Contact = new Entity("contact");
Contact["cr04d_accountlookup"] = new EntityReference(logicalName, LookupId);

Regards,

Sultan from Bangalore

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Leaderboard > Bengaluru or Bangalore Dynamics 365 User Grup

Featured topics

Product updates

Dynamics 365 release plans