You need to sign in to do that
Don't have an account?
Nani@408
Automatic update The phone Field on Contact Object
Hai ,
Req:Initially Phone Field is Empty on Contact Object.when i saving some record with some Name ,.
i want to save that record automatically with some phone number also
This is my code:
trigger automatic on Contact (before update)
{
List<String> ContactNames =new List<String>{};
if(trigger.isbefore && trigger.isupdate){
for(contact c:Trigger.New)
{
c.Phone='9999999999';
}
}
}
i got it Through Before update..But my requirement is Through After Update..help me
Thanks in Advance
In after update your trigger will go in infinite loop, beacuse its setting off the trigger again. See the link below to get it work in after update.
http://www.salesforce.com/docs/developer/cookbook/Content/apex_controlling_recursive_triggers.htm
Thanks