Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Referential, Rollup or Other to pull field data between two entities?

(0) ShareShare
ReportReport
Posted on by

I have a situation where we have a custom entity called Sales Order

In the Sales Order, we want to document the User who made the sale from the system User entity

In the User entity we have a field called Commission Rate

After we do a lookup in the Sales Order to the User, we would like that User's Commission Rate to populate a Decimal field in Sales Order for the same thing

I'm struggling with the best way to do this and can't seem to find a good solution with N:1 relationships or a Rollup.

I've been able to get the N:1 mappings to work find on new record creation and static picklists but not with a Lookup where I want to pull other field data over after I've done that Lookup.

Any suggestions?

Thank you.

*This post is locked for comments

  • Verified answer
    RE: Referential, Rollup or Other to pull field data between two entities?

    Thank you Srikanth.  So I wanted this to run asynch, without any user intervention.  Each time there is a change and record saves, updates occur.  I would prefer a real time update but AFAIK, that could only be done with JS.  

    You are correct about the potential conflicts for user 1 or 2 so what i decided was to segregate them into 2 different workflows.

    I've tested quite a bit and this seems to allow for either sales rep 1 or 2 changing, and changing back.

    I decided against making the field read-only because if a user were to make a mistake and select the wrong sales rep and then wanted to correct it, they would be unable to.  correct me if I'm wrong.

    Otherwise, this solution seems to do the trick.

    11_2D00_12_2D00_2016-4_2D00_16_2D00_15-PM.gif

    11_2D00_12_2D00_2016-4_2D00_16_2D00_15-PM.gif

  • Suggested answer
    ansrikanth Profile Picture
    ansrikanth 3,115 on at
    RE: Referential, Rollup or Other to pull field data between two entities?

    First thing, based on your screenshot, are you interested to run this as background wf rather than real time ? I guess, you would be interested in making it realtime. Use the ribbon button in wf editor to convert to real time.

    And this workflow will fire whenever there is a change in the 1st/2nd Sales rep, but the problem is, whenever any of this field is changed, it will check for both fields and increments/adjusts the field value. If you don't want that to happen, then divide the wf in to 2 for each field.

    If you don't want this field to be changed once after updating the commission field, use a business rule to make this rep field read-only if you found a value in commission field.

  • RE: Referential, Rollup or Other to pull field data between two entities?

    Great suggestion - thank you!

    One basic WF question though which I have yet to find an answer to:  I've added a 2nd sales rep to the form, and if I want this to trigger any time either/both of these 2 fields change (first rep, 2nd rep), would I explicitly define a stop step in the WF?  If not, what's to keep it from running up to 7 times an hour, in perpetuity?  I'm thinking that I have to define a condition to stop it and once the reps have been paid, that would be it.  Otherwise, this would just run as long as the record was active correct?

    Thank you.

    11_2D00_11_2D00_2016-2_2D00_24_2D00_54-PM.gif

  • Suggested answer
    ansrikanth Profile Picture
    ansrikanth 3,115 on at
    RE: Referential, Rollup or Other to pull field data between two entities?

    Yah, in which case WF is the best option for you with only drawback of "save" the form first to see the value.

  • RE: Referential, Rollup or Other to pull field data between two entities?

    Thank  you.  i should have included in my post, "without using JS" - my JS coding skills are VERY limited and trying to find reliable, professional, cost-effective, US resources for this are very challenging, so i have to find ways to solve this problem on my own, using existing tools that are integrated with CRM 2016.  I think the earlier reply about WF is the solution.

  • Suggested answer
    ansrikanth Profile Picture
    ansrikanth 3,115 on at
    RE: Referential, Rollup or Other to pull field data between two entities?

    You can use javascript also to pull the user record from webapi and place the commission value to the required field.

  • Verified answer
    Rutul Chauhan Profile Picture
    Rutul Chauhan 2 on at
    RE: Referential, Rollup or Other to pull field data between two entities?

    Hi Daniel,

    I would suggest you to create workflow to pull commission rate from user entity to field in sales order on selection of user in Sales order.

    You can check condition if user contains data.

    Workflow should be start on field(User) change on Sales order

    And then update sales order in workflow.

    This is how commission rate can be pulled to sales order based on user

    Regards,

    Rutul

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans