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

Announcements

No record found.

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

I have the same question (0)
  • Suggested answer
    imayur Profile Picture
    630 on at

    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

  • Community Member Profile Picture
    on at

    Hi Mayur, thanks for the reply

    Can you elobarate clearly

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Community Member Profile Picture
    on at

    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
    Mahendar Pal Profile Picture
    45,095 on at

    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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April 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