1

I have an Incident entity in CRM 2016 that has an ownerID which relates to a User entity. On that User entity, I have a Location field, which is based on a global option set.

On my Incident form, how would I be able to automatically populate a location field, based on the owner that's selected?

Pops
  • 468
  • 2
  • 15

2 Answers2

4

If you just need to show the value you can create a Quick View Form and put it on the form.

If you need to copy the value, because it's a lookup, you can create a Workflow that will copy the value when the record is created or reassigned.

Guido Preite
  • 14,905
  • 4
  • 36
  • 65
1

Or - Adding to Guido's Answer - if you want the user to be able to see the value on the form when it loads, you'll need to use the Rest API to query for the Location value of the owner. Use the FetchXmlBuilder for the XrmToolBox to generate the URL that you'll need.

Daryl
  • 18,592
  • 9
  • 78
  • 145
  • After querying it through Rest API, where he is supposed to show the retrieved Location on? Don't he need to have a field on form for this? If yes isn't it a bad idea to set the value of that field on form load?? because it will make the form dirty!! – Yaqub Ahmad Oct 28 '16 at 16:42
  • In my reading of the OP, he already has a location field on the Incident, that he is attempting to populate based on the location field of the Owner. You're right in that setting it on load will potentially give you that warning that something has changed. Generally though, users are opening the form to update it anyway, so that is negligible. If it was a major concern, you could populate the field on the form, but set it to not be updated, so it wouldn't be considered dirty, and update it on the back end via a rest call. – Daryl Oct 28 '16 at 16:52