+ Start a Discussion
SrinuSrinu 

Error when submitting opportunity for approval - failing after Winter 14

Hi,

 

I have a trigger on opportunity, which submits the record for approval when it mets the criteria. But some how it is giving error:

 

Error Message when saving an opportunity:

 

OpportunityObject: execution of AfterInsert caused by: System.DmlException: Process failed. First exception on row 0; first error: INACTIVE_OWNER_OR_USER, owner or user is inactive. Org Id:00D80000000aP47 User Id:005800000036h9Y: [] Trigger.OpportunityObject: line 258, column 1

 

Line 258 in my trigger:

 

// create the new approval request to submit
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setComments('Submitted for approval. Please approve.');
req.setObjectId(Trigger.new[i].Id);

// submit the approval request for processing
Approval.ProcessResult result = Approval.process(req);

 

Debug Log:

16:40:26.868 (1868370000)|WF_PROCESS_NODE|Step 1(Approval based on first response)
16:40:26.873 (1873156000)|WF_NEXT_APPROVER|Test User1|User|
16:40:26.874 (1874235000)|WF_NEXT_APPROVER|Test User2|User|  -->(Users defined in Approvel Process)
16:40:26.875 (1875200000)|WF_NEXT_APPROVER|Test User3|User|
16:40:27.512 (2512015000)|EXCEPTION_THROWN|[EXTERNAL]|System.NoAccessException: Invalid connected application: Chatter_for_iOS with Namespace: sf_chttr_apps
16:40:27.515 (2515129000)|EXCEPTION_THROWN|[EXTERNAL]|System.NoAccessException: Invalid connected application: Chatter_for_Android with Namespace: sf_chttr_apps
16:40:27.644 (2644188000)|CODE_UNIT_FINISHED|Workflow:ApprovalProcessActions
16:40:27.644 (2644403000)|DML_END|[258]
16:40:27.644 (2644565000)|EXCEPTION_THROWN|[258]|System.DmlException: Process failed. First exception on row 0; first error: INACTIVE_OWNER_OR_USER, owner or user is inactive. Org Id:00DV00000087oVG User Id:00580000003SS10: []
16:40:27.646 (2646404000)|SYSTEM_METHOD_EXIT|[258]|Approval.process(Approval.ProcessRequest)
16:40:27.646 (2646531000)|FATAL_ERROR|System.DmlException: Process failed. First exception on row 0; first error: INACTIVE_OWNER_OR_USER, owner or user is inactive. Org Id:00DV00000087oVG User Id:00580000003SS10: []

Trigger.OpportunityObject: line 258, column 1
16:40:27.646 (2646558000)|FATAL_ERROR|System.DmlException: Process failed. First exception on row 0; first error: INACTIVE_OWNER_OR_USER, owner or user is inactive. Org Id:00DV00000087oVG User Id:00580000003SS10: []

Trigger.OpportunityObject: line 258, column 1

 

My Understanding: I tried to execute this code in full sandbox & UAT. Error is coming with different inactive user. I believe who ever is inActive and retrived by code and error is coming with that inActive User.

1. I jus want to know the whats the relation between opportnity crating User & inActive User. 

2. Is this causing Error: Chatter_for_iOS with Namespacesf_chttr_apps

                                           Chatter_for_Android with Namespacesf_chttr_apps

 

Any suggestions would be greatly appreciated !!

Ashish_SFDCAshish_SFDC
Hi Srinu, 

Looks like trigger is dynamically pulling the User through the record which is an Inactive User. 

Did you try by changing the Approver use from the Inactive one to a Active user. 

Put a exception in Class when such Situation occurs and Comes up with a readable error message stating the User selected for Approval is an Inactive User and Need to Select a User who is Active. 

Regards,
Ashish