Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set the related feild of one entity to the field of another entity

(0) ShareShare
ReportReport
Posted on by

I had 3 custom entities called promotion coupon and member . In the member entity i created a text field called coupon id which is not linked to any of other entities and in the coupon entity i have lookup feild for promotion  .Here the problem is i want to compare the coupon id feild in the member entity with coupon id field in the coupon entity . If it matches the coupon id in the member entity that coupon id should link to the promotion . I want javascript code for it or any suggestions would be helpful

Thank you

*This post is locked for comments

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Set the related feild of one entity to the field of another entity

    Hello,

    You can write a retrievemultiple query where you can look for coupon id from member entity into coupon entity, as suggested use Rest builder to design your query, if facing any issue share it here.

    Thanks

  • RE: Set the related feild of one entity to the field of another entity

    Hi,

    I want know how to connect the Coupon Id in the member entity to the promotion code of coupon entity because the member entity does not have any relation with other 2 entities

    Thanks

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 Moderator on at
    RE: Set the related feild of one entity to the field of another entity

    As Mayur suggested, REST API is probably your best bet here, to be able to query the data in other entities.

    The CRM Rest Builder by Jason Lattimer will help you build the queries.

    github.com/.../CRMRESTBuilder

    The REST API JavaScript file is part of the Microsoft Dynamics SDK, which you can download from the Microsoft web site.

    Make sure that you download the version for CRM 2013.

    There are also samples of using the REST API within the SDK.

    Hope this helps.

  • RE: Set the related feild of one entity to the field of another entity

    Hi Mayur, thanks for the reply

    Can you elobarate clearly

  • Suggested answer
    imayur Profile Picture
    imayur 630 on at
    RE: Set the related feild of one entity to the field of another entity

    Hi,

    You can use filter on both entities couponid and memberid(primary key for member) with desired couponid  , if the query returns the record means you have match otherwise couponid does not match.

    User CRM rest builder to create rest query 

    so you can create fech xml to build above query and concat you memberid and coupenid variables

    and put in below field (Check screnshot) 

    3007.1111.JPG

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…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

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,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans