You need to sign in to do that
Don't have an account?
MMuneee
Trigger getting error
//update shipping address with billing address
trigger afterinsertbillingstreet on Account (After insert) {
list<Account> li;
for(Account a:trigger.new)
{
a.ShippingCity=a.BillingCity;
a.ShippingCountry=a.BillingCountry;
a.ShippingLatitude=a.BillingLatitude;
a.ShippingLongitude=a.BillingLongitude;
a.ShippingPostalCode=a.ShippingPostalCode;
a.ShippingState=a.BillingState;
a.ShippingStreet=a.ShippingStreet;
// li.add(a);
}
//update li;
}
trigger afterinsertbillingstreet on Account (After insert) {
list<Account> li;
for(Account a:trigger.new)
{
a.ShippingCity=a.BillingCity;
a.ShippingCountry=a.BillingCountry;
a.ShippingLatitude=a.BillingLatitude;
a.ShippingLongitude=a.BillingLongitude;
a.ShippingPostalCode=a.ShippingPostalCode;
a.ShippingState=a.BillingState;
a.ShippingStreet=a.ShippingStreet;
// li.add(a);
}
//update li;
}
What error are you facing?
Thanks,
Pratik
Try using before insert & before update event in your above trigge, it shold work.
Thanks,
Pratik
P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
Hi Muneendar,,
The field names should be:
ShippingCity, ShippingCountry, ShippingState, ShippingStreet, ShippingPostalCode and accordingly the Billing fields.
a.ShippingCity=a.BillingCity;
a.ShippingCountry=a.BillingCountry;
a.ShippingLatitude=a.BillingLatitude;
a.ShippingLongitude=a.BillingLongitude;
a.ShippingPostalCode=a.BillingPostalCode;
a.ShippingState=a.BillingState;
a.ShippingStreet=a.BillingStreet;
Hope this will help you.
Thanks,
Pratik