I am looking for an approach that when a user profile (e.g. Office Administrator) creates a new account and the administrator must assign another user (e.g. Account Manager) as the Account Owner when the administrator tries to save the record. Is it possible to do this? If so, what's the approach? I tried to look for the field security, or layout but it doesn't allow the administrator to change the Account Owner when try to create a new account.

2 Answers 2


Assuming the names you mention in your question are profile names, this code will automatically change the owner when the Account is inserted for 'Office Administrator' profile users to a 'Account Manager' profile user:

trigger AccountBeforeInsert on Account (before insert) {
    Id oaId = [select Id from Profile where Name = 'Office Administrator'].Id;
    if (UserInfo.getProfileId() == oaId) {
        Id amId = [select Id from Profile where Name = 'Account Manager'].Id;
        User[] users = [select Id from User where ProfileId = :amId and IsActive = true];
        // Need to pick one of the Users; this is arbitrarily just taking the first
        Id uId = users[0].Id;
        for (Account account : Trigger.new) {
            account.OwnerId = uId;

Use account triggers to do that. You can create custom setting to map newly created account to user who should be owner (based on some value in your account).

You can also create flow for administrator to create new account (I am not 100% sure - but I think this should allow him to change owner).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .