You need to sign in to do that
Don't have an account?
Sudhir_Meru
Lower Case and Upper Case value in Trigger
Hi,
I created a trigger to check the Billingstate. In below trigger if user enter ALABAMA it will update as AL.
What if user enter Alabama or alabama how to convert this into upper case please suggest.
trigger Update_Account_BillTO_ShipTO_State on Account (Before Insert, Before Update) { for (Account a : Trigger.new) { if ( a.BillingState == 'ALABAMA' ) { a.BillingState = 'AL'; } } }
Thanks
Sudhir
trigger Update_Account_BillTO_ShipTO_State on Account (Before Insert, Before Update)
{
for (Account a : Trigger.new)
{
if ( a.BillingState.toUpperCase() == 'ALABAMA' )
{
a.BillingState = 'AL';
}
}
}
All Answers
trigger Update_Account_BillTO_ShipTO_State on Account (Before Insert, Before Update)
{
for (Account a : Trigger.new)
{
if ( a.BillingState.toUpperCase() == 'ALABAMA' )
{
a.BillingState = 'AL';
}
}
}
@Naveen Nelavelli?
How would you create a trigger for the requirement below?
Add a trigger to Salesforce that automatically converts Account Email address to lower case & updates the Customer ID field with that email address. Account Email and Customer ID fields are both located on the account page layout (Person Account).
Thanks,
Maurice