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>();
         if(!=null &&!=trigger.newmap.get(o.Id).name){
             task t=new task();  
            // t.What='opportunity';
    insert tasks;
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( );
req1.setSubmitterId( UserInfo.getUserId() );
// if you have an approval process
req1.setProcessDefinitionNameOrId('approval process name or Id');
Check out for more info.

The above is also not bulkified so in a gtrigger you may be best server using this answer: