MDA: How to disable/set view selector for Lookup in BPF

As you know already, in one Table (Entity), we can create lots of Views. And by default, when we add that table in the form (as Lookup control), the User can see all the views and change it. That is why common in the business requirement to set the control to only use certain views (to minimize record selection) like in the below picture:

Set up the Default view for the lookup control

But when we are working in the Business Process Flow, we don’t have those options settable (below is a sample of my BPF):

Create sample BPF

When defining the lookup attribute, we only have those properties to set.

When interacting with the BPF here we can see the “Advance lookup” link:

When lookup being clicked, we can select the Advance lookup.

After clicking that, the Advance dialog appeared > we can change the views (in our scenario, we don’t want the user to change the view in this control):

View can be change by the User

Solution

Whenever we create the BPF, the system will create a new table for us. When we try to open the Form definition of the BPF, unfortunately, we can’t change anything there:

But knowing this, I try to add this BPF (including the Table) into my solution and also a sample of the Lookup settings from the Form which I want to apply in the BPF later on:

Once you export the solution (must use unmanaged), I use below Microsoft Power Platform CLI command:

pac solution unpack -z .\Solutions\Blog_Customizations.zip -f .\Unpack\Blog_Customizations\ -e verbose

Once the unpack files are generated, you can try to check out the sample lookup that you already set:

The lookup properties XML

I then copy those XML (the tag parameters) > open the BPF Entity\FormXml\main and add the properties XML inside it. So here are my changes before and after:

Paste the parameters XML inside the target control

Once you did this, click save and then you need to pack the folder into the solution using the below command:

 pac solution pack -z .\Solutions\Blog_Customizations_Fixed.zip -f .\Unpack\Blog_Customizations\

The last part is to import the Blog_Customizations_Fixed.zip and don’t forget to Publish All Customizations!

Here is the result:

Demo result

Happy CRM-ing!

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.