You need to sign in to do that
Don't have an account?
cool 183
Auto approval process record unlock
hi,
I have created a custom button and a vf page to edit a record that is locked due to approval process. I wrote a trigger for auto approval process using after update and after insert events.The problem arises when i use after update in trigger.when i make some changes in the vf page and try saving it, it throws this error,
Visualforce ErrorHelp for this Page
System.DmlException: Update failed. First exception on row 0 with id 0069000000bgC3WAAU; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Approvalprocess1: execution of AfterUpdate caused by: System.DmlException: Process failed. First exception on row 0; first error: ALREADY_IN_PROCESS, Cannot submit object already in process.: [] Trigger.Approvalprocess1: line 12, column 1: []
Error is in expression '{!saveAs}' in component <apex:commandButton> in page edit_opportunity: Class.EditOpportunity.saveAs: line 38, column 1
Class.EditOpportunity.saveAs: line 38, column 1
This error does not occur when i use only after insert event. can anyone please help me ..
I have created a custom button and a vf page to edit a record that is locked due to approval process. I wrote a trigger for auto approval process using after update and after insert events.The problem arises when i use after update in trigger.when i make some changes in the vf page and try saving it, it throws this error,
Visualforce ErrorHelp for this Page
System.DmlException: Update failed. First exception on row 0 with id 0069000000bgC3WAAU; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Approvalprocess1: execution of AfterUpdate caused by: System.DmlException: Process failed. First exception on row 0; first error: ALREADY_IN_PROCESS, Cannot submit object already in process.: [] Trigger.Approvalprocess1: line 12, column 1: []
Error is in expression '{!saveAs}' in component <apex:commandButton> in page edit_opportunity: Class.EditOpportunity.saveAs: line 38, column 1
Class.EditOpportunity.saveAs: line 38, column 1
This error does not occur when i use only after insert event. can anyone please help me ..
Record editability options (make sure the second option is selected from below)
Only Administrator should unlock the record,once submitted
Both Admin or Approver can unlock the record during approval request
Record Lock options (Make sure "Unlock the record for editing is selected" from below options)
Lock the record from being edited
Unlock the record for editing
Hope this helps.
I wanted the record owner to edit the record even after submitted for approval.. I checked wat u have said, but tat dint work for my scenario.. I have created a custom button in object detail page..This button redirects u to a vf page similar to the obj detail page. if i make changes in that page and try saving it, it throws the above said error..I have used after update and after insert events to initiate the approval process for a record.. after update event causes this error..
Can you check the below link .You need not create Button and VF Page .You can control using record type .
https://developer.salesforce.com/forums/?id=906F00000008xk5IAA
Let me know if this does not helps .
--Vineet