CRM portals 8.0 plugin validation message

Question Status

Suggested Answer
Davey asked a question on 6 Oct 2017 12:33 PM

Hi everyone,

We have created a pre-validation plugin which stops users associating duplicate membership records to an account so that it works for CRM and the portal.

This plugin works fine. However, the message that gets displayed on the portal when we do an association of a duplicate record is:

 "An unknown failure has occurred. Error ID #{GUID}"

I want to display the message that is thrown in the plugin exception as it is like in CRM.

Is there a way to achieve this or a way to alter the error box by using JavaScript? 

Reply
Suggested Answer
Alex Shlega responded on 6 Oct 2017 12:40 PM

Hi Davey,

 AFAIK you can't display a friendly message (no matter where you register the plugin - pre-validation/pre-op/post-op.. )

Reply
Davey responded on 6 Oct 2017 1:32 PM

Thank you Alex. Are there any workaround for my problem in preventing  duplicate records being created without using plugin?

Reply
Suggested Answer
Arpit Shrivastava responded on 6 Oct 2017 11:41 PM

Hi Davey,

You can achieve it by Creating a custom Submit button on portal form and hide the original one. Now you can write an Odata query on click of your custom button to check (based on your duplicate condition) whether submitting record already exist in crm. If yes then show the user friendly error message else perform click (using code) on OOB submit button.

For odata you can refer my below article:

Hope it helps.

Cheers

Arpit

Reply
Suggested Answer
Alex Shlega responded on 6 Oct 2017 12:40 PM

Hi Davey,

 AFAIK you can't display a friendly message (no matter where you register the plugin - pre-validation/pre-op/post-op.. )

Reply
Suggested Answer
Arpit Shrivastava responded on 6 Oct 2017 11:41 PM

Hi Davey,

You can achieve it by Creating a custom Submit button on portal form and hide the original one. Now you can write an Odata query on click of your custom button to check (based on your duplicate condition) whether submitting record already exist in crm. If yes then show the user friendly error message else perform click (using code) on OOB submit button.

For odata you can refer my below article:

Hope it helps.

Cheers

Arpit

Reply