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 Service forum

update case subject using C#

(0) ShareShare
ReportReport
Posted on by

Hello All,

I have a requirement to update case subject using C# code dynamically. 

We have created a field i.e., Service which relates to out of box Subjects as shown below. We need to set the field value to either of the options using C# code. Any code help or pointers will be helpful. Looking forward to your inputs.

CaseSubject.PNG

Thank you.

Regards,

Mehboob

Categories:
I have the same question (0)
  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    subject is a lookup.

    3782.35.png

    So use below code to set it.

    Entity case= new Entity("incident");

    case["subjectid"] = new EntityReference("subject", "Place your subjectid in here");

  • Community Member Profile Picture
    on at

    Hello Fun,

    Thank you for reverting. Sure will try and check. Can you also tell me how to retrieve the subjectid?

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    you can refer below article on how to construct query to retrieve records. Remember you have to change the fetchxml , you can use advanced find to do that.

    [View:https://msdn.microsoft.com/en-us/library/gg328117.aspx]

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans