You need to sign in to do that
Don't have an account?
Shreekant Sahu
Set value for Created By field of an object in Salesforce
In salesforce I have a requirement that, I need to set the Created By field value to a particular user, irrespective of the user who creates it through UI/Apex. So how can I do that?
You can try this one -
1) Create a prermission set.
2) Go to Created permission set -> System Permission.
3) Look for "Set Audit Fields upon Record Creation" and make it true.
4) Assisgn that 'permission set' to the login user.
5) Now try to create a recrod. It should work. Hope this will help you.
Thanks,
Sumit Kuamr Singh
All Answers
You can try this one -
1) Create a prermission set.
2) Go to Created permission set -> System Permission.
3) Look for "Set Audit Fields upon Record Creation" and make it true.
4) Assisgn that 'permission set' to the login user.
5) Now try to create a recrod. It should work. Hope this will help you.
Thanks,
Sumit Kuamr Singh
Hello Sumit,
So here - to get the above functionality always we need the help of apex code, right?
We can not do anything for the records created through UI.
Thanks,
Shreekant Sahu
You can create through UI also. If the page is standard page follow this steps-
1) Create a lookup "Created by User" field to 'User' on the object.
2) Create permission set and assigned to the user (As mentioned in the previous comment.)
3) Create a section on the standard page, and show the custom "Created by user" field on the edit layout. Hise this on detail page layout. On detail page layout show the standard 'created by' field.
4) Create a work flow rule/ process/trigger to copy the value from custom "Crated by User" field to standard "Created by" field.
Hope this will help you. If you still need help ping me on skype "sumit3887"
Thanks,
Sumit Kumar Singh