Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Change owner field based on a dynamic user lookup on the form

(0) ShareShare
ReportReport
Posted on by

Hi All,

I'm trying to change the owner field of a custom entity record to the same value in another user lookup on the form (set owner field value as resource).

4008336.Capture.PNG

I've tried to create a WF that assign records but it seems I can't select my custom user lookup ("Resource") in the properties:

2352.Capture1.PNG

 

This needs to happen on create and it's not like one of two records that I can go and change the values by hand.

Does anyone know how to achieve this functionality?

Thanks,

- Bod 

*This post is locked for comments

  • Sma Profile Picture
    60 on at
    RE: Change owner field based on a dynamic user lookup on the form

    Hi,

    I am also searching for a solution to this.  So, do you able to get the solution to this problem?

    Regards,

  • Aneeqa Pervaiz Profile Picture
    240 on at
    RE: Change owner field based on a dynamic user lookup on the form

    Hey,

    I know this is a very old post, but I was wondering if you found the solution to this?

  • Community Member Profile Picture
    on at
    RE: Change owner field based on a dynamic user lookup on the form

    So the point is that it's not.

    SystemUser is the owner field lookup and that equates to the Created By user probably.

    The Resource lookup field is a BookableResource (Field Service) user system field. And although they need to be the same user eventually there's no way to identify it bc the guid/entityType differs from one another. So for example user "AAA BBB" that derives from systemUser entityType != "AAA BBB" that is in the bookable resource user list (I believe that's waht Guido Preite was trying to explain). 

    Basically, the situation is this:

    A call schedule form is created and then we drag it to the schedule board for a field service technician. However, the tech can't see the assigned call to him since he's not the owner.

    Hence, I was trying to default the owner field to same value of the resource field.

    Is it possible to take for example the resource name value from the lookup like so:

    var resName = Xrm.Page.data.entity.attributes.get("resource").getValue()[0].name;

    loop through the systemUser records based on that value alone (without the id/entityType) and re set the value of the owner lookup field when a match has been found? meaning name to name.

  • Suggested answer
    Alagunellaikumar Profile Picture
    6,210 on at
    RE: Change owner field based on a dynamic user lookup on the form

    Hi Bodipal

    If system user and bookableresource  "name" is same, then we can achieve through JS or Plugin

    Please follow the below steps:

       In the on change event of owner lookup

       Get the owner lookup value name

       Retrieve bookableresource  through web API, apply filter by name of the bookableresource =system user lookup value

           [Organization URI]/api/data/v8.2/bookableresource?$filter=new_name eq 'name of the user lookup'

       In onsuccess event of retrieve bookableresource , you will get "bookableresource Id" and you set the value to bookableresource lookup

  • Community Member Profile Picture
    on at
    RE: Change owner field based on a dynamic user lookup on the form

    yeah I understand...

    Well, in light of what I've described above and all.

    Are there any alternatives that achieve the functionality I need?

    Thank you


  • Community Member Profile Picture
    on at
    RE: Change owner field based on a dynamic user lookup on the form

    There's no way to do it with js instead of a wf?

  • Community Member Profile Picture
    on at
    RE: Change owner field based on a dynamic user lookup on the form

    Resource lookup points to an ootb entity named "bookableresource" it's not systemuser but yes it is an ootb entity under Field service.

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans