web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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

I have the same question (0)
  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    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..

  • Srini20 Profile Picture
    397 on at

    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.

  • Suggested answer
    Srini20 Profile Picture
    397 on at

    Thanks, Alex.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans