You need to sign in to do that
Don't have an account?
Deek
Clone Account Owner Field in Account object
Hi Moderators,
I need to create a new field in Account object which is identical to Owner field (Field Label:Account Owner) of data type [Lookup(User)] which is a standard field in Account?
Could you please help me on how to achieve this?
Thanks Utsav for all your help. Its working fine now with your code.
All Answers
If I understand correctly then its simple , you should create a new lookup field and associate it to the User Object. If you want to populate it with the same value of the the owner(standard) field then you need to write a workflow rule on Account where ownerId!=NULL (created, and any time it’s edited to subsequently meet criteria). Copy the value of ownerId field to this new field. Is this what you want to achieve. If not then let us know your use case as well.
Thanks
Utsav
[Do mark this answer as solution if it works for you and give a kudos.]
Hi Utsav,
The current Owner field in Accounts has some existing business rules which I dont want to disturb. Thats the reason I want a cloned field of "Owner" which will be used for other purpose. The values in this field will be same as is the current standard field.i.e showing up the users list.
Create a User lookup field on Account Object and then write a workflow rule to copy the Owner field value to new Owner Field.
You should be able to create a formula field to get the value or the name of the Owner.
Thanks
Utsav
[Do mark this answer as solution if it works for you and give a kudos.]
Hi Utsav,
I have created the lookup field to user in Account object.
Could you please eleborate the steps on the creation of WF rule and then create a formula field to get the value or the name of the Owner.
trigger trgUpdateAccountOwner on Account(before Insert,before Update) {
List<Account> accountLists = new List<Account>();
for(Account a: Trigger.new) {
a.newOwnerId = a.ownerId;
accountLists.add(a);
}
}
Thanks
Utsav
[Do mark this answer as solution if it works for you and give a kudos.]
Thanks Utsav for all your help. Its working fine now with your code.
Thanks
Utsav
[Do mark this answer as solution if it works for you and give a kudos.]
Thanks Utsav.
One quick reply please,
In Events object there is a customized pick list field called as "YOR
Status" which has values planned, completed, cancelled and system close
respectively.
My requirement is "YOR status" cannot be set to "Completed" if the
start date of the Event is greater than today.
Please help me out to achieve this.
Notice
This email and any attachments are strictly confidential and subject to copyright. They may
contain privileged information. If you are not the intended recipient please delete the message
and notify the sender. You should not read, copy, use, change, alter or disclose this email or
its attachments without authorisation. The company and any related or associated companies do
not accept any liability in connection with this email and any attachments including in connection
with computer viruses, data corruption, delay, interruption, unauthorised access or unauthorised
amendment. Any views expressed in this email and any attachments do not necessarily reflect the
views of the company or the views of any of our related or associated companies.
Use formula AND, it may look something like below
AND(Yor status='xyz', startdatetime=TODAY)
Thanks
Utsav
[Do mark this answer as solution if it works for you and give a kudos.]