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
SFDC ROCKSFDC ROCK 

process builder to trigger

how can I move below process builder on trigger code.

object : abc

Condition :    abc.pstatus  equal   picklist   preveiw
                     abc.rstatus  equal   picklist   sreveiw
                      abc.initail  equal   picklist   sales
                      abc.initail   equal    picklist calli
                      abc.type equal   picklist   rtype
                      abc.dtype equal   picklist   aac
            
            custom logic 
            
            (1 AND 4)or (2 AND 3) AND 5 AND 6
            

Action : insert and update on acb object

         record:   abc
         
        field:          status equal done        

         inseet and update on different object def
         
         record:   abc.def
          
        field:            status equal done      

Thanks,   
ANUTEJANUTEJ (Salesforce Developers) 
Hi there,

You could use something linke below:

trigger triname on abc(before insert)
{
if(trigger.isbefore && trigger.isinsert)
{
list<object> ln= new list<object>();
for(object o: trigger.new){
if(conditions you are checking ){
//do the operations if true
}
if(other conditional check)
{//do the statements you want to execute.}}
}
}

You could use something link above with your conditions and you should be able to implement your use case.

I hope this helps.

Regards,
Anutej