Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

plugin in dynamic 365

(0) ShareShare
ReportReport
Posted on by 95

Hi All,

I am new to plugins concept in dynamic 365.In One entity form i have option set field when user change to "1800000" value then i have to create copy of that record(all fields values) in another entity which having same fields .so  i am tried one plugin on update on option set i am trying to create record in another entity but i am not able know how to set and retrieve lookup fields .can any one help me??

2134.plugin.PNG

  • LeoAlt Profile Picture
    LeoAlt 16,331 on at
    RE: plugin in dynamic 365

    Hi Dinesh,

    If my answer helped you, please mark my answer as verified to close this post and we could also help other people with similar issues at the same time.

    Best Regards,

    Leo

  • LeoAlt Profile Picture
    LeoAlt 16,331 on at
    RE: plugin in dynamic 365

    Hi Dinesh,

     

    I noticed that you have worked with EntityReference class,

     

    > Firstly I assume the entity is your retrieved result, so the lookup field retrieve code would be below:

     

    EntityReference lookup = entity.GetAttributeValue<EntityReference>("cor_lookup");

     

    > then the set code for your new customerorder_child record would be below:

     

    customerorder_child["cor_lookup"] = new EntityReference(lookup.LogicalName, lookup.Id);

     

    > If you would like to view the updated lookup field name, you should execute service.Retrieve() again.

     

    Best Regards,

    Leo

  • Casper Schau Profile Picture
    Casper Schau 35 on at
    RE: plugin in dynamic 365

    Hi 

    The issue for you is that on an Update, you will only get a few information in the property bag, such as the GUID and the updated field.

    If you need the hole entity, as you do in your case, you will need to do a Service.Retrieve() call, like this:

    Entity contact = service.Retrieve("account", account.Id, coulmnSet);

    Here the parameters are the logicalname of the entity you want to retrieve, the id of the entity you want to retrieve, and the columnset that you want to retrieve (The fields on the account you need to duplicate. If all just set it to True)

    Please make as suggested answer if it solves your issue.

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

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans