You need to sign in to do that
Don't have an account?
Lwc Seekar
Need Help for simple trigger using TERNARY OPERATOR
Scenario: if any of the address field is blank i would like to propulate it with text dummy using Ternary operator as if i use if else it will become lenghty.
trigger AddressFields_Insert on Lead (before insert ,before update) {
for(Lead ld :Trigger.new )
{
if(Street==null|| City==null || PostalCode==null || State==null || Country==null){
Street = 'dummy' ;
City= 'dummy' ;
PostalCode= 'dummy' ;
State= 'dummy' ;
Country= 'dummy' ;
}
}
}
trigger AddressFields_Insert on Lead (before insert ,before update) {
for(Lead ld :Trigger.new )
{
if(Street==null|| City==null || PostalCode==null || State==null || Country==null){
Street = 'dummy' ;
City= 'dummy' ;
PostalCode= 'dummy' ;
State= 'dummy' ;
Country= 'dummy' ;
}
}
}
try with below code.
If this helps, Please mark it as best answer.
Thanks!!
All Answers
try with below code.
If this helps, Please mark it as best answer.
Thanks!!