Notifications
Announcements
No record found.
Hello,
I'm looking for the way to allow specified user to set default value for a lookup field, it should be accessible from form view so it can be easily changed. Is it even possible?
I thought about some workflow, but could it be customized by user?
Thank you for any help,
Henryk
Hi,Instead of Workflow, you can use the CRM based script as follow:1. By default lock the lookup field on form.2. Create one security role. For e.g. "Default Lookup Role"
3. Now in script we can access the security role of the user as shown below:
link https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-utility/getglobalcontext/usersettings
4. If user has "Default Lookup Role" then unlock the field.5.Else lock the field.
Same thing we can achieve using Team.
1. Create Team and all required user in it.2. After this get the team name if user is part of New team then lock/unlock the same lookup field.
Thanks,Pradeep.Please mark this as VERIFIED if it helps.
But can i set this value as default for all new entities?
Yes. You can set the default values.
But for all required entities(new/old) you need to register the script on forms.
and to set lookup please refer below screenshot:
reference link:https://carldesouza.com/how-to-set-a-lookup-field-to-another-lookup-field-on-a-dynamics-365-power-apps-form-using-javascript/
Thanks,Pradeep.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 83 Super User 2025 Season 2
Gerardo RenterÃa Ga... 49 Most Valuable Professional
#ManoVerse 40