Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, Power Apps, Power Automate, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates and new features to Dynamics 365 planned through March 2020
Release overview guides and videos Release Plan | View virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
We have a requirement where the user will not have access to some of the data in 'ABC' entity. Based on certain conditions, the data should be fetched from this entity using impersonation and populate in the lookup field of a different form. Since the user has append to organization privilege he should be able to select the data.
ABC Entity Privilege – User can see the records where he is the owner.
CDE Entity Form–
Logged in User - Brian
ABC Field should display all the records basis ACC No. So he should be able to see below records in Lookup Field.
Now through impersonation I can fetch the data but how to populate the data in pre search event of lookup field.
As per my understanding, were you going to filter records that are owned by current user in lookup field ?
For more detailed description: you just want Brian to select ABC data/records that are owned by him when he visiting CDE Entity Form ?
If so, a full code would be below to achieve your requirement:
Just fire AddPreSearch function at form onLoad event, and replace parameter in getControl with your ABC field logical name.
my example is filtering parent accounts for current user in Account form.
This will not work as the user doesn't have the privilege. He can see the records where he is the owner. In your fetchXML condition you are fetching basis the owner.
Sorry to have misunderstood your thought,
As per my re-understanding, would your real requirement be below?
You current user has prvActOnBehalfOfAnotherUser privilege,
but he had retrieved ABC entity records which couldn't be retrievable for his current security role by impersonated user,
then now you would like to give a similar rendered result drop-down as addPreSearch function to lookup field ?
(because "pre populated field" could only make me think of you were working impersonation with Web API at front-end, while I don't know whether plug-in could do it)
Please point out whether there is still any misunderstand.
Business Applications communities