SBX - Search With Button

SBX - Forum Post Title

CRM portals 8.0 plugin validation message

Microsoft Dynamics CRM Forum

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

Question Status

Suggested Answer

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
Alex Shlega responded on 6 Oct 2017 12:40 PM
My Badges
Suggested Answer

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

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
Alex Shlega responded on 6 Oct 2017 12:40 PM
My Badges
Suggested Answer

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

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

SBX - Two Col Forum

SBX - Migrated JS