You need to sign in to do that
Don't have an account?
![Darb Darb](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Trigger to change the user
I have a custom objects that receives records from an external system. When the records come in I want to assign them to a specific user to maintain security. I believe a trigger would work best but have no experience creating one. Can anyone help?
You should read the Triggers section in the APEX Language Reference
http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf
Triggers work fairly straight-forwardly. You can specify them to run on different types of operations.
In your case, you'd probably be using a "before insert" trigger to set the owner of the record before it is inserted into the system.
Further, you might want to look into Workflow Rules. It may save you from having to code.
All Answers
You should read the Triggers section in the APEX Language Reference
http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf
Triggers work fairly straight-forwardly. You can specify them to run on different types of operations.
In your case, you'd probably be using a "before insert" trigger to set the owner of the record before it is inserted into the system.
Further, you might want to look into Workflow Rules. It may save you from having to code.
I have a trigger (after update) which sends an email, I have to change the running user in apex code before sending the email. Could anybody guide me through the process ?