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 2

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.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: MSCRM how to write plugin for validation when convert to case from task entity

    Glad that it worked.

    Please mark my answer verified if i were helpful

  • Suggested answer
    EmployeeOcta Profile Picture
    EmployeeOcta 2 on at
    RE: MSCRM how to write plugin for validation when convert to case from task entity

    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.

  • EmployeeOcta Profile Picture
    EmployeeOcta 2 on at
    RE: MSCRM how to write plugin for validation when convert to case from task entity

    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
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: MSCRM how to write plugin for validation when convert to case from task entity

    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
    EmployeeOcta 2 on at
    RE: MSCRM how to write plugin for validation when convert to case from task entity

    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
    Bipin D365 28,961 Moderator on at
    RE: MSCRM how to write plugin for validation when convert to case from task entity

    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
    EmployeeOcta 2 on at
    RE: MSCRM how to write plugin for validation when convert to case from task entity

    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
    Bipin D365 28,961 Moderator on at
    RE: MSCRM how to write plugin for validation when convert to case from task entity

    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

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans