web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

MSCRM how to write plugin for validation when convert to case from task entity

(0) ShareShare
ReportReport
Posted on by 6

Hello All Experts,

I need to write a prevalidation plugin on.

1. When creating a case from task entity by using convert to case button.

2. I need to check whether in the customer field the entity type is account only.

query: I am bit confused like which message of plugin do i need to choose here? likewise more details i need .

any help will be appreciable.

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Plugin step message would be create only.

    Only thing you would need to check is parentcontext to know if case is getting created from task.

    Please mark my answer verified if i were helpful

  • EmployeeOcta Profile Picture
    6 on at

    Hello Bipin,

    Thanks for the update,

    Could you please elaborate more how do i check parent context.

    it will be more appreciable.

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    You can check using plugin context.

    see below link for the properties present in IPluginExecutionContext.

    docs.microsoft.com/.../microsoft.xrm.sdk.ipluginexecutioncontext

    Please Mark My Answer Verified If I Were Helpful

  • EmployeeOcta Profile Picture
    6 on at

    Hi Bipin ,

    thanks for your update now i am able to read that property , but i am not sure how to utilize it to understand if case is getting created from task.

    and also give a Business Process Error from Convert To Case popup window.

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Today i tried in my instance. So basically you have to check if parent context MessageName equals to ConvertActivity. Also Parent context PrimaryEntityName equals to activitypointer when case record converted from task. See below image and highlighted section for your reference.

    3757.CQ3.PNG

    However when you create directly from case grid parent context will be null.

    Please Mark My Answer Verified If I Were Helpful

  • EmployeeOcta Profile Picture
    6 on at

    Hello Bipin ,

    Thanks for your update , but what actually i am trying here is that , i need to show a custom message when click of Convert Button, but i am not able to show that.

    is there any limitation that i cannot show custom message from plugin when Convert button from convert to dialog is clicked?

  • Suggested answer
    EmployeeOcta Profile Picture
    6 on at

    Hello All ,

    I have change step registered on prevalidation to preoperation and the plugin started working from Convert To button as well .

    Thanks for all your help an dsupport.

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Glad that it worked.

    Please mark my answer verified if i were helpful

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans