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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to update Ticket number field of Case using code

(0) ShareShare
ReportReport
Posted on by 483

Hello,

Iam trying to update ticket number field of CASE but it is not updating . Is there any way to update ticket number which is already generated while creating case  .

Entity objcase = new Entity("incident", entity.Id);
objcase .Attributes["ticketNumber"] = "33843483"; 

_orgService.Update(objcase );

Thanks,

Krishna Prasad.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    BadrinathB Profile Picture
    970 on at
    RE: How to update Ticket number field of Case using code

    Hi Krishna,

    It is not possible to update the ticketNumber field directly. If you want to use custom case numbers you can do that using a plugin with precreate event. Have a look here for better understanding.

    community.dynamics.com/.../custom-generation-of-case-number

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: How to update Ticket number field of Case using code

    Hi Krishna,

    the ticket number field on incident entity is not valid for update meaning you cannot update this field.

    205413.1.png

    However you might be able to overwrite the out of the box numbering on a "pre-validation" plugin.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: How to update Ticket number field of Case using code

    Hi Krishna ,

    The workaround is to introduce new custom field which you can update . So try with some custom field , you can have a look my article to create custom auto number .

    goutamdascrm.wordpress.com/.../dynamics-365-auto-number

  • dkrishna Profile Picture
    483 on at
    RE: How to update Ticket number field of Case using code

    But we are using Out of box field TicketNumber. We cant change now because system is already in Iive. We need to update some of the cases which are created with Default Format starts with CAS as we have our format for all the cases . Is there any alternative way by update to IsValidForUpdate property ?

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: How to update Ticket number field of Case using code

    Hi

    If the case you are trying to update does not have loads of related records, you could consider exporting and importing the Case to update the Ticket Number

    2045.ScreenClip-_5B00_222_5D00_.png

    Once you exported, if you want to maintain the record GUIDs, then you will have to delete the original records before you re-import.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans