0

My question is similar to: How can I import data owned by people who are not Salesforce users?. I realize I can't import new records that are owned by an inactive user account, but will I be able to update the data on an existing Account or Opportunity if the owner account has been deactivated?

Some of our accounts will have owners who leave the company, but we will want to keep them up to date since we continue to service the account without reasigning to an active user.

  • If I'm understanding the question correctly, I'm fairly certain the answer to this is yes - simply because you can edit records that are owned by inactive users through the UI – Brian Mansfield Nov 16 '15 at 23:06
  • What matters here is CRUD permissions, sharing rules, and system permissions like Modify All Data; active users always have the 'potential' to update records owned by inactive users, subject to access control rules – cropredy Nov 17 '15 at 0:57
  • @crop1645 - I'm using the data loader with the permissions of an admin. The owner of the accounts will be a user account that I do now want to remain active. Regardless of the CRUD permissions of the admin, new accounts cannot be added if they are owned by an inactive user account. Does that mean you can't update either? – JeffO Nov 17 '15 at 15:29
  • you can definitely update records owned by inactive users subject to CRUD, sharing, system permission rules of the running user – cropredy Nov 17 '15 at 17:23
  • @crop1645 - You cannot create records if the owner has an inactive user account with the Data Loader. – JeffO Nov 17 '15 at 18:18
2

Winter 16 introduced a new feature allowing insertion of Sobjects with inactive owners as well as establishing setup fields like createdDate without having to call SFDC support (super helpful in doing Data Migration). There is also a lengthy user commentary over the lack of such feature here at Success

Setup | User Interface

enter image description here

With the checkbox setting value off, if I use Data Loader, to insert an Account with an inactive Owner

NAME                    OWNERID         ERROR
sfse_foo_dataloader_03  005d0000001nCZ3 operation performed with inactive user [005d0000001nCZ3] as owner of account

Same error if using Apex

Account a = new Account (name = 'sfse_foo_00', 
                         ownerId = [select id from User where isActive = false limit 1][0].id);
insert a;
FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; 
      first error: INACTIVE_OWNER_OR_USER, operation performed with inactive user [005d0000001nCZ3] as owner of account: []

Now, as System Administrator (Modify All Data permission), if I try and update an Account with an inactive user as Owner:

update [select id from Account where createdDate = TODAY and owner.isActive = false];

This works fine

With the checkbox setting value on, if I use Data Loader, to insert an Account with an inactive Owner

ID                  NAME                OWNERID         STATUS
001d000001uZTLuAAO  sfse_foo_dataloader 005d0000001nCZ3 Item Created

Works fine as does the equivalent Apex.

Note per the doc:

The organization preference defaults to off unless you’ve previously contacted Salesforce to enable the “Create Audit Fields” permission, which the organization preference replaces.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.