Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to get one entity values and create record in other entity

(0) ShareShare
ReportReport
Posted on by 240

Hi All,

I am new to plugin in crm 2016.I am trying to create a plugin for case entity and invoice.I have custom field name casetype(data type is optionset) i want to get that values and if the case type is incident i can select case type when creating or later i can change case type in update too  then i want to get create a record  in invoice with case title and assign case id to caseid  (lookup field)    its a relation to  invoice.

Thank You

*This post is locked for comments

  • Suggested answer
    pavanmanideep Profile Picture
    pavanmanideep 1,329 on at
    RE: How to get one entity values and create record in other entity

    Hi Madiri,

    You could try to get the values of the field in the First Entity(Case) either through the Plugin Context or through the image created for this Case entity containing this custom field and by comparing it's value as per your exact need and requirement.

    If the condition was met, then you could include code like below to complete this, remember you should retrieve _InvoiceId,_Casetitle from the Post image.

       invoice Invoiceentity = new invoice

                   {

                       Id = _InvoiceId,

                       Casetitle = _Casetitle,

                    };

    service.Update(Invoiceentity);

    Hope this would help you to the best.

    Thanks,

    PMDY

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

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,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans