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
jagadeesh deepu 3jagadeesh deepu 3 

whenever new account is created , submit the record for approval??

trigger Opportunity_task on Opportunity (after update) {
    list<task> tasks=new list<task>();
     for(Opportunity o:trigger.new){
         if(o.name!=null && o.name!=trigger.newmap.get(o.Id).name){
             task t=new task();  
             t.Subject='call';
             t.Priority='high';  
            // t.What='opportunity';
            tasks.add(t);             
         }
            }
    insert tasks;
}
AngrySlothAngrySloth
Not sure what you are asking, since you just put in some code for creating a task and you question is about approval process but I will take a shot in the dark ( and please if you want people to spent their time helping you, take time yourself to clearly explain what is troubling you )

You can submit for approval using apex as follows
Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
req1.setComments('Submitting request for approval.');
req1.setObjectId( opportunity.id );
req1.setSubmitterId( UserInfo.getUserId() );
// if you have an approval process
req1.setProcessDefinitionNameOrId('approval process name or Id');
Approval.process(req1);
Check out https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ProcessSubmitRequest.htm for more info.

The above is also not bulkified so in a gtrigger you may be best server using this answer:
https://developer.salesforce.com/forums/?id=906F0000000BUztIAG