Thursday, July 28, 2022

Regarding (Advanced Lookup) Tables filtering in MSCRM

Scenario: Need to filter the Regarding (Advanced Lookup) Tables.

Step 1. Check Lookup schema name




Step 2. Check loaded tables in Lookup


Step 3. Click on Advanced Lookup 

Step 4. You can find list of Tables

Step 5. I want to show only 'account','contact','lead','msdyn_warehouse','msdyn_vendor','incident' in the Table list.

Step 6. I have written JS

function setCustomFilter(context)
    {
        debugger;
        var formContext = context.getFormContext();
        var lookup = formContext.getControl("regardingobjectid");
 
        //check if multiple type dropdowns enabled for this lookup
        if (lookup.getEntityTypes().length > 1) {
            lookup.setEntityTypes(['account','contact','lead','msdyn_warehouse','msdyn_vendor','incident']);            
        }
    }

Step 7. Triggering above function on form load.

Output:

On form load, It will load only 6 entity (table)s records.


here you can find the list of tables.




*** Thank you










No comments:

Post a Comment