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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Portal -Execute Dynaic...
Power Pages
Unanswered

Portal -Execute Dynaics 365 FetchXML from entityform

(0) ShareShare
ReportReport
Posted on by 120

Hi,

 

We are trying to resolve a hopefully simple problem. We need pass the login user id to retrieve another entity record in CRM/CDS and set that as a lookup on the entityform on the load.

 

I wonder if somebody could share an example where Dynamics 365 retrieve operation is done perhaps via FetchXML in the entityform javascript and result parsed therefore lookup value set on the form?

 

Thanks

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi

     

    you don't need to perform a retrieve to get the current's user id, there is a Liquid object that you can get it very easy: {{ user.id }}

     

    to set lookup value via JS you can refer to the following:

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/262869/setting-value-on-lookup-field-using-javascript-in-crm-portals

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • UmerJaved Profile Picture
    120 on at

    Hi @OliverRodrigues 

     

    As mentioned we are not trying to retrieve login user id, instead we are using that id to retrieve another entity record which needs to be setup as lookup on the current entityform on load.

    Hence my question as how we can make such call from custom JavaScript(FetchXML/ODATA?) to retrieve related entity and set that as lookup on entityform?

  • Verified answer
    OOlashyn Profile Picture
    3,496 Most Valuable Professional on at

    Hi @UmerJaved ,

     

    I wrote an article on how to dynamically filter and set data to lookup fields. Check it out - I think this approach will help you.

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    yes, but you need the current logged in user id to retrieve the additional records, isn't that your requirement?

    to get the id you use the liquid object I mentioned earlier

     

    then you can use that ID in your Fetch / oData

  • UmerJaved Profile Picture
    120 on at

    Thanks @OOlashyn . I'll try the link/article you suggested and come back if any questions.

  • EmployeeOcta Profile Picture
    on at

    Hi OOSYLYN,

    As per the article it's rendering as dropdown , but my query here i need to select the default value in the lookup field, which is not in this case.

     

    is there any possibility we can by default choose that.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard