locked
pre-create plugin to update the suffix of a case id with current year and month RRS feed

  • Question

  • I need to replace the suffix(6 digit) of case id with current month and year( CAS-10000-201411) using a pre create plugin.

    Thanks

    Wednesday, November 19, 2014 7:21 AM

All replies

  • Hi,

    You can use the code below

     if (Entity.Attributes.Contains("ticketnumber"))
                {
                    string[] newticket = Entity["ticketnumber"].ToString().Split('-');
                    Entity["ticketnumber"] = newticket[0] + " - " + newticket[1] + " - " + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
                }


    If you find this post helpful then please Vote as Helpful and Mark As Answer. Thanks and Regards, Polat Aydın My blog

    Wednesday, November 19, 2014 11:31 AM