Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

retrieve parent id in field using plugins

(0) ShareShare
ReportReport
Posted on by

34106804.Capture.PNG

I want to retrieve parent account name in the field top level pal name and parent pal number in top level pal in case account AGO has a parent accont, if it does not have AGO then the same name AGO sits in the field top level pal name(schema name say - xzc. Can anyone help me to write the code please

*This post is locked for comments

  • RE: retrieve parent id in field using plugins

    community.dynamics.com/.../829867 please help me this one...

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: retrieve parent id in field using plugins

    Hi Suchisuch,

    You could do this with real time workflow. If you still want to do this using plugin, have you tried anything yet? The high level changes would be as follows-

    1. Retrieve the executing entity from Input Parametrs i.e. Entity entity = (Entity)context.InputParameters["Target"];

    2. Check if the entity contains parent account i.e. entity.Contains("parentaccountid")

    3. If it contains then again retrieve that account record i.e. service.Retrieve("account", <guid of the parent account>, newColumnSet(true));

    4. After retrieving the paraent account details, update the details to the account field

    5. If no parent account the directly update the field with account field.

    Hope this helps.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

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