function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NBK27NBK27 

Get status change on cases

When the status of a case is changed, I need to update this in a third party application. Seems like CaseStatus doesnt allow triggers. How can I achieve this ? On each status change in the Case, I need to send the actual Status of the case along with CaseID to an external application. Is this possible ? Any help regarding this would be appreciated. Thank you.

Best Answer chosen by Admin (Salesforce Developers) 
kranjankranjan

Hi NBK,

 

I dont think you need to go for CaseStatus trigger. You should be able to simply use the trigger on Case object and check its status field if it has changed bay comparing in trigger.old and trigger.new and do whatever you want to do based on that. Hope this helps. Something like this:

 

trigger CaseStatus on Case (after insert, after update) {
{

	for(Case c: Trigger.new)
	{
	    if((Trigger.isInsert || (Trigger.oldMap.get(c.Id).Status != c.Status )
	    {
		// DO WHAT YOU WANT OT DO
	    }
	}
}

 

 

Regards

All Answers

kranjankranjan

Hi NBK,

 

I dont think you need to go for CaseStatus trigger. You should be able to simply use the trigger on Case object and check its status field if it has changed bay comparing in trigger.old and trigger.new and do whatever you want to do based on that. Hope this helps. Something like this:

 

trigger CaseStatus on Case (after insert, after update) {
{

	for(Case c: Trigger.new)
	{
	    if((Trigger.isInsert || (Trigger.oldMap.get(c.Id).Status != c.Status )
	    {
		// DO WHAT YOU WANT OT DO
	    }
	}
}

 

 

Regards

This was selected as the best answer
NBK27NBK27

Hi Kranjan,

 

Thank you so much. I will look into the Case object.

 

Thanks & Regards,

NBK

kranjankranjan
Sounds good. Let me know if you were able to work it out with this or need any more help.

Regards
NBK27NBK27

Hi Kamal,

 

This worked out for me :)

 

Thanks & Regards,

NBK