+ Start a Discussion
Ron WhitmanRon Whitman 

Can an API user be set inactive automatically? API returned “cannot reparent record” for active user

I have a web application that uses the Salesforce API to create Contact, Account, Opportunity records. We set up an administrator user with full permissions to use as the Oauth login user, and I use it as an admin for development. I went on vacation so this system admin user was being used for API access only for over a week.

Then all of a sudden the system started returning errors to me (using Django/Python for my client, pasting verbatim) 
SalesforceError: {u'errorCode': u'CANNOT_REPARENT_RECORD', u'fields': [], u'message': u'owner is inactive, cannot reparent record'}

Thing is the owner in this case should be the system user I created and any other records that would have been touched with it are owned by active users. I logged into the SF web interface with my admin user, the errors stopped but I'm not sure if it was related.

My question is - is it possible that the user was flagged as inactive automatically? I can't find a setting that would change this. Would it be caused by something else or am I on the right track?
Hi!  I don't think the service account user was the problem.  If it were inactive you wouldn't be able to connect to the API at all.  Are you doing any updates or only inserts?

My guess is a trigger or workflow on Contact/Account/Opportunity that is trying to update the OwnerId to an inactive User.