You need to sign in to do that
Don't have an account?
Sunny Sohail
Illegal assignment from String to Integer
Hello,
im am trying to create a trigger that will update any accounts employee size from blank to 10 and i am getting an "Illegal assignment from String to Integer" error message. The below code should update any account that has a NULL employee size to 10. Any help would be useful.
trigger UpdateEmployeesize on Account (Before insert,after update) {
for (account accountinloop: Trigger.new){
if(accountinloop.NumberOfEmployees== 'NULL'){
accountinloop.NumberOfEmployees='10';
}
}
}
im am trying to create a trigger that will update any accounts employee size from blank to 10 and i am getting an "Illegal assignment from String to Integer" error message. The below code should update any account that has a NULL employee size to 10. Any help would be useful.
trigger UpdateEmployeesize on Account (Before insert,after update) {
for (account accountinloop: Trigger.new){
if(accountinloop.NumberOfEmployees== 'NULL'){
accountinloop.NumberOfEmployees='10';
}
}
}
null is the value that means "no value". 'NULL' is a string.
All Answers
null is the value that means "no value". 'NULL' is a string.
trigger UpdateEmployeesize on Account (Before insert,after update) {
for (account accountinloop: Trigger.new){
if (accountinloop.NumberOfEmployees== null )
accountinloop.NumberOfEmployees=10;
}
}
thank you :)