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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to get owner field in current context

(0) ShareShare
ReportReport
Posted on by 255

Hi all,

i want to trigger one plugin on change of owner filed on case

i have written code and registered step on assign message.

will i get owner id field in current context?

can anybody share code and steps how to trigger plugin on change of owner field and get the owner field in current context.

I have the same question (0)
  • Mona Chavan Profile Picture
    255 on at

    can anybody reply fast?

  • Mona Chavan Profile Picture
    255 on at

    which assembly reference i need to add for Moniker ?

  • Mona Chavan Profile Picture
    255 on at

    I have to write plugin on change of owner id field which will take some related entity records and send email to newly assigned owner.

    i am done retrieving related records but not able to get updated owner in current context can anybody please help me .

  • Suggested answer
    Pawar Pravin Profile Picture
    5,237 on at

    Hi Mona,

    You could get it using entity reference as like:

    EntityReference assigneeRef =

                          (EntityReference)context.InputParameters["Assignee"];

    Please refer below url for more details:

    thinkingincrm.blogspot.com/.../consume-assign-sdk-message-in-crm-2011.html

  • Mona Chavan Profile Picture
    255 on at

    I have this line in my code

    if(context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)

    my plugin is on Assign message

    after debugging code i get result false for above if condition

    can anybody clarify this

  • Suggested answer
    Pawar Pravin Profile Picture
    5,237 on at

    Hmmm. As mentioned above you should have to check entityreference in place of entity.

    if (context.InputParameters.Contains("Target") &&

                        context.InputParameters["Target"] is EntityReference)

  • Mona Chavan Profile Picture
    255 on at

    Thanks

    I am facing one problem while registering this plugin on Assign.

    if i write Entity Reference there i am not able to take Current Entity record Id.i need case id further to get its related records by passing case id in fetch.

    what shall i do in this case?

  • Verified answer
    Pawar Pravin Profile Picture
    5,237 on at

    Both the values you would get into context only

    pastedimage1575454329591v2.png

  • Mona Chavan Profile Picture
    255 on at

    Thnaks Pravin,

    can you please explain why we are using Entity Reference there?

  • Mona Chavan Profile Picture
    255 on at

    Thnaks Pravin,

    can you please explain why we are using Entity Reference there?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 184 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 125

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans