Skip to main content
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:
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: update case subject using C#

    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]

  • Community Member Profile Picture
    on at
    RE: update case subject using C#

    Hello Fun,

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

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: update case subject using C#

    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");

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

News and Announcements

Now Available: 2025 Release Wave 2

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

Featured topics

Product updates

Dynamics 365 release plans