Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Plugin Obtaining organization and fields from parent entity

Posted on by 210

I'm a .Net developer writing my very first Dynamics CRM Plugin - please excuse my very basic questions.  I need to do the following and I am unsure what object's to utilize.

The PlugIn is running on the create of various entities.  I want to look at the parent entity and obtain the value of a field "sharepointurl" (which is on all these entities. As the logic is

1-If contract set sharepointurl

2-If contract change then look at the contract entity and get the value stored in "sharepointurl" and do logic then set contract change "sharepointurl"

3-If RFI, Letter, RFP, and others then look at the contract change and get the value stored in "sharepointurl" and do logic then set RFI, Letter, RFP, and others "sharepointurl"

How do I look at this "parent" object and how can I see the contents of the field?

Secondly, I need to obtain the organization in order to determine the base of this URL (as we have more than one organization sharing a sharepoint in our non-prod servers.  My logic is

1- If organization is the production organization then sharepoint URL is xxxxxxxx

2-If organization is mycrmdev then sharepoint URL is xxxxxxxx

3-If organization is mycrmsbx then sharepoint URL is xxxxxxxx

4-etc....

How do it find the organization?

Again sorry for the basic questions but this is the first time out and I'm brand new and need guidance from those with experience.

Diane

*This post is locked for comments

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Plugin Obtaining organization and fields from parent entity

    Retrieving field values within a plug-in is the same as retrieving the data from any .NET application. If you have the GUID of the record you want to retrieve then you can use the Retrieve method. The following page provides sample code for both early-bound and late-bound development: https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.iorganizationservice.retrieve.aspx

    For general plug-in tips, please see my wiki page on the topic: http://mscrmrocks.wikispaces.com/CRM+Plug-ins

  • Verified answer
    TNS Profile Picture
    TNS 1,195 on at
    RE: Plugin Obtaining organization and fields from parent entity

    Hi...

       First of all you have to connect with your organization...and might this link will be helpful:

    arunpotti.wordpress.com/.../get-all-crm-organizations-using-discovery-service-in-c-and-sdk

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans