You need to sign in to do that
Don't have an account?

Quick Trigger HELP
I am trying to write a trigger that will populate a contact lookup field with a specific contact. I am struggling to figure out how to code the specific contact into the trigger.
Check out the code and you will see what I mean...
Any help would be MUCH APPRECIATED! Thanks guys!
Check out the code and you will see what I mean...
Any help would be MUCH APPRECIATED! Thanks guys!
trigger CampaignTrigger on Campaign (after insert) { for(Campaign camp:Trigger.New){ if(camp.Project_Manager__c == null) camp.Project_Manager__c = WHAT DO I PUT HERE?? THE USERS ID? } }
Use User Id (If Project_Manager__c is lookup or master to user
who is the project manager for any campaign
Brother @Raj wrote the answer but it's not bulikfied.
If you will help me , when do you want to assign project manager, or how conatct and project manager are related. If you willgive me the explaination.
Below code can fulfill your requirements, Hope this will work for you.
Please mark this as best answer if this solves your problem.
Thank you,
Ajay Dubedi