cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UmerJaved
Helper III
Helper III

Portal -Execute Dynaics 365 FetchXML from entityform

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

View solution in original post

6 REPLIES 6
OliverRodrigues
Super User II
Super User II

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-fie...

 

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

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.




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.

Power Apps Portals Super User


Oliver Rodrigues


 

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?

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.

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

View solution in original post

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




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.

Power Apps Portals Super User


Oliver Rodrigues


 

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

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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Users online (30,071)