Hi - was anyone in the Moving Clicks to Code Session at DF11? I was introduced to this Trigger during that session.
The problem I am trying to solve is bringing User ID information to the Contact record (for the purpose of reporting).
The trigger (obtained from DF11 session) is working but it is returning the saleforce unique ID to the custom field I created on the Contact record and I can't access the fields.
I am sure that I set my field up incorrectly to receive this information. I think it should be a formula.
Help Please!
Thank you
3 answers
trigger OwnerCopy on Contact (before Insert, before Update) {
//handle arbitrary number of contacts
for(Contact x:Trigger.New){
//check that owner is a user
if(((String)x.OwnerID).substring(0,3)=='005'){
x.Owner_Detail__c=x.OwnerID;}
else{
x.Owner_Detail__c=null;
}
}
}