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
chinnyychinnyy 

urgent requirement on trigger pls help me

Hi,

The requirement is like when the status=open or reopen till the record is saved it has to capture the time,for this help me out how to write trigger .Bsaed on the time the SLA Flag has to set.

 

Thanks,

Indu.

 

Suresh RaghuramSuresh Raghuram


can you elaborate it, Bsaed on the time the SLA Flag has to set.
For your Basic Idea
If the Flag has to set when a record is created and the status = open or reopnen
It would look like this.
trigger <trigName> on <Objt Name>(after Insert,after Update){
objName objjVar = objName();
If (objVar.Status == 'Open' || objVar.Status == 'reopen'){
objVar.Flag = true;
}
update objVar;
}

chinnyychinnyy

Hi Suree thanks for your reply.My actual Requirement is find below.

Capturing time when status is open or reopen till it is closed in case object to set SLA flags.Bases on this
time I need to set flags according to the durations below.

From Case Created and Case Status = Open

Green = Case Age < 10 hours

Yellow = Case Age > or = 10 hours and < or = 15 hours

Red = Case Age > or = 16 hours

Pls help me in fixing this issue.

 

 

 

Thanks,

Indu