Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to display custom error messgae on CRM UI using plugin

Posted on by Microsoft Employee

there is a plugin on retrieve and retrieve multiple of account and contact entity 

so when i open a record i need to display the custom error message on crm UI .

its a synchronous execution mode and pre- validation execution pipeline stage

i tried using the try catch and in catch 

catch (InvalidPluginExecutionException e)
{
localcontext.Trace(string.Format(CultureInfo.InvariantCulture, "Exception: {0}", e.ToString()));
throw new InvalidPluginExecutionException(e.Message);

}

so unable to display the message on UI 

currently i am getting business process error

71673.ERROR.PNG

*This post is locked for comments

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: How to display custom error messgae on CRM UI using plugin

    The Business process error is common but lines below are coming from your invalidpluginexecutionexception which is "ISV Code aborted the operation".  which simply means the your exception method is working.

    Are you expecting something else. ?

    To verify that your exception is working and fine , try and put a custom message (throw new InvalidPluginExecutionException("meesage here......");

    you should now focus on debugging and find the culprit line in the code.

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: How to display custom error messgae on CRM UI using plugin

    Hi Archi,

    While throwing InvalidPluginExecutionException in the plugin, it will always display in Business Process Error window.

    The message you pass will be displayed in the alert.

    See: community.dynamics.com/.../127832

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans