function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger Userinsert on Account (before insert) { List<user> users = [select id from user where Name='Custom User' limit 1]; for(account acc:trigger.new ){ if(acc.user__c == Null){ acc.user__c = users[0].id; } } }
Account is lookup to user object?
Thanks!!
which user you need to link to the account when created.?
Thanks!!
Do you have existing user with the name of "Custom User" ?
if yes, try with below code.
If this helps, Please mark it as best answer.
Thanks!!