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
SabrentSabrent 

INACTIVE_OWNER_OR_USER, operation performed with inactive user:

I don't see any inactive user, neither is there a trigger that chnages ownership. Yes i keep getting this error.

 

Any thought?? Thakns.

 

 

|FATAL_ERROR|System.DmlException: Insert failed. First exception on row 16; first error: INACTIVE_OWNER_OR_USER, operation performed with inactive user: []

Tim BarsottiTim Barsotti

What action are you attempting to perform? What record is row 16? 

Saikishore Reddy AengareddySaikishore Reddy Aengareddy

Check if there are any workflows which change the ownership, Assignment rules(case/Lead), Default case owner etc

SabrentSabrent

The code is inserting records. Basically granting portal access to the users.

 

There is no workflow that is changing ownership.

 

I tried a small subset of records, even that fails.

 

I checked all users and none is inactive. 

Tim BarsottiTim Barsotti

Post your code please.

dev_sfdc401dev_sfdc401

Any clue.. me too getting same error while doing insert on custom object

SabrentSabrent
In my case it was a sharing rule that was causing the error. Our code is very convoluted so it's difficult to post.
dev_sfdc401dev_sfdc401

In my case customObject's ownerId is set to event ownerId before insert..
is this causing the problem.. in that case what are the possible scenarios to replicate the error..

SabrentSabrent

check if the event owner that you are assigning is active or inactive?

Also, check your test class. Are you using test owner which is inactive?

 

Put some debug logs to get a better idea.

Can you post your trigger snippet?

dev_sfdc401dev_sfdc401

due to some reasons I cannot copy my code..

this issue happened to the user while doing some opertations from frontend..
am trying to recreate the exception by making Event owner inactive.. but am not getting this exception

//so below line is not creating the issue

customObject.OwnerId = someEvent.OwnerId;

I would like to know what all scenarios will create INACTIVE_OWNER_OR_USER exception.

 

tonantetonante
I would check any workflows. For example I was coding a class to use Apporval Process Submit Request  Apex for a custom object called Affiliation (based on the Non-Profit Started Pack). When I created a test class and ran it on this code I got the same error
trigger affiliationApprovalSubmit on npe5__Affiliation__c (after insert) {

 for (npe5__Affiliation__c aff : trigger.new) {
     if(aff.Other_Role__c == 'Advocate' && aff.npe5__Status__c == 'Pending'){
     
         Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
         req.setComments('Submitting request for approval automatically using Trigger');
         req.setObjectId(aff.id);
         
         Approval.ProcessResult result = Approval.process(req);
     }
   }

}

: The solution was this:  I created a log file and reran the test and found that our SFDC Admin had made the approver account inactive for an employer who is no longer employed with us however he name is still defined within the Work Flow to approve processes.
19:02:35.765 (4765232535)|WF_EVAL_ENTRY_CRITERIA|ADV - Approve Advocate Applications|00X500000019FEI|true
19:02:35.765 (4765246406)|WF_PROCESS_FOUND|ProcessDefinitionNameOrId:04a50000000Ci4B|Applicable process was found.
19:02:35.797 (4797374786)|WF_SPOOL_ACTION_BEGIN|Auto Evaluate
19:02:35.817 (4817955604)|WF_PROCESS_NODE|Advocate Approval(Approval based on first response)
19:02:35.875 (4875373903)|WF_NEXT_APPROVER|Maria Pucinski |User|
So I went to the Approver Work flow and substituted Maria's name with a current  employer.  So always check to see that the Execution Contex is not prohibting your test cases or classes for functioning. I hope this helps someone.