You need to sign in to do that
Don't have an account?
its chantee
Trigger
Hi to All
I Have one doubt whenever we create a record on Account Object , while we enter the Billing Address Field Value , The same Value as display the Mailing Address Without Clicking the Copy Billing Address to Shipping Address
I Done By using Triggers by using Before Insert Event it working
But I want it By using After Insert Event Can Plse suggest and give me Explanation also
I Have one doubt whenever we create a record on Account Object , while we enter the Billing Address Field Value , The same Value as display the Mailing Address Without Clicking the Copy Billing Address to Shipping Address
I Done By using Triggers by using Before Insert Event it working
But I want it By using After Insert Event Can Plse suggest and give me Explanation also
You have done it in using right approach.In before insert we can manipulate the value of record but in case of after insert we are not allowed to do that.We can achieve it using update DML operation on after insert Trigger.
Please refer Salesforce guide
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#CSHID=apex_triggers.htm|StartTopic=Content%2Fapex_triggers.htm|SkinName=webhelp
if this answer helps,please mark it as best answer to help others:)
Thanks,
All Answers
The difference we use after and before insert ,if we use before insert then we could change or manipulate the values of the fields datas thats submitted.
in after we cannot do so,it would be like update.
in trigger if you are editing the record field you can compare the old values using trigger.old() please refer.
Thanks
D Naveen Rahul.
You have done it in using right approach.In before insert we can manipulate the value of record but in case of after insert we are not allowed to do that.We can achieve it using update DML operation on after insert Trigger.
Please refer Salesforce guide
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#CSHID=apex_triggers.htm|StartTopic=Content%2Fapex_triggers.htm|SkinName=webhelp
if this answer helps,please mark it as best answer to help others:)
Thanks,