Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Opportunity parentcontactid

(0) ShareShare
ReportReport
Posted on by 397

Hi,

I am running into an issue in a common plug-in that i created for Opportunity and Lead (Plugin registered on Create step). I need to read the parentcontactid value in Lead and Opportunity create logic.

After registering the plug-in Lead plug-in works fine but the opportunity plug-in is failing with "parentcontactid doesn't exist for opportunity". I have the contact lookup on both Lead and opportunity form and also on Process Flow section. Below line works fine for Lead but its failing opportunity.  Am i doing any thing wrong? I checked all the name and relationship looks fine but failing with the error for opportunity plug-in

Guid contactid = ((EntityReference)entity.Attributes["parentcontactid"]).Id;  

*This post is locked for comments

  • Suggested answer
    Srini20 Profile Picture
    397 on at
    RE: Opportunity parentcontactid

    Thanks, Alex.

  • Srini20 Profile Picture
    397 on at
    RE: Opportunity parentcontactid

    Thank you. Its strange but i observed the same thing. I am able to retrieve the form parentcontactid now not sure with the exact problem though i selected the contact some times its not coming entity.Attribute.

  • Verified answer
    ashlega Profile Picture
    34,477 on at
    RE: Opportunity parentcontactid

    If you are not updating/populating parentcontactid, there will be no such attribute in the Target. Either use pre/post image, or do a Retrieve..

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,188 Moderator on at
    RE: Opportunity parentcontactid

    Hi,

    Are you using Target to get the entity or are you calling service.Retrieve to retrieve the entity?

    If you are unable to see the attribute try using service.Retrieve(entityName, entityId, columns) and see if you are getting results.

    Sometime using Target doesn't retrieve the results that you are looking for.

    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans