You need to sign in to do that
Don't have an account?

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;
}
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;
}
You can submit for approval using apex as follows 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