You need to sign in to do that
Don't have an account?
Ishan Singh 4
In some leads a field name 'state' is blank i want to update those field's state with default and then execute my main field update in batch class
for(Lead l: scope)
{
if(l.State!=''){ //State is not empty
l.State__c =l.State__c;
}else{ //State is empty
l.State__c ='Default';}
l.Age__c = l.Current_Age__c;
}
update scope;
}
{
if(l.State!=''){ //State is not empty
l.State__c =l.State__c;
}else{ //State is empty
l.State__c ='Default';}
l.Age__c = l.Current_Age__c;
}
update scope;
}
I think you are trying to update State__c with State.
Try the below code:-
Thanks
Anil.B
All Answers
I think you are trying to update State__c with State.
Try the below code:-
Thanks
Anil.B
If date field i.e, dateOfBirth__c is empty then I to update it with 1991-01-01. Can you give any solution?
Thanks Anil,
If date field i.e, dateOfBirth__c is empty then I to update it with 1991-01-01. Can you give any solution?The above solution is not working for this requirement.