Power platform Plugin design mistakes which often make you mad…!!!

Hello friends,

Below blog details about the common plugin design mistake which often make you spend hours together to troubleshoot….

  1. Make sure you properly verify the filtering attributes are missing
  2. Don’t unnecessarily include all the parameters in the Pre/Post image
  3. Don’t retrieve all the data in your fetch queries
  4. Make sure your operation doesn’t take long time when you were trying to perform any synchronous operation.
  5. Check if any other operation is blocking your action or pushing your action to go next.
  6. Try to use trace log if you were able to call the plugin
  7. In some cases, if you have any issue with the plugin registration tool to profile, alternatively you can put this method of logging to trace out the issue.
  8. Use depth property to prevent infinite loop execution.

Hope you found at least you are able to understand why your plugin doesn’t trigger now.

Thank you…that’s it for today….

Cheers,

PMDY

addPreSearch and addCustomFilter to your lookups in Dynamics 365

Using these methods we can now easily filter the lookup in Dynamics 365.

Using addPreSearch we can specify a handler to PreSearch Event. Inside the handler we can specify our fetch xml query that can be used for filtering. The filter applied in the fetch xml will be combined with the any previously added filter as an ‘AND’ condition.

To remove the filter we can use removePreSearch method.

formContext.getControl(arg).addPreSearch(myFunction)

  1. Pass execution context
  2. Specify the argument which is nothing but the lookup field you want to addPresearch functionality.

Example:

formContext.getControl(“csz_consumedproduct”).addPreSearch(filterConsumedProductLookup);

function filterConsumedProductLookup(executionContext) {
debugger;
var entityLogicalName = “product”;
var filter = ” <filter>” +
” <condition attribute=’name’ operator=’not-like’ value=’%Accompanied%’ />” +
” </filter>”;
executionContext.getFormContext().getControl(“csz_consumedproduct”).addCustomFilter(filter, entityLogicalName)
}

Cheers,

PMDY

Cheers,

PMDY