This error generally arise when you are comparing datetime field value to string.
Example
DateTime dt = system.now();
if(dt != null && dt !='') { // This line gives error as '' is a string
}
Solution : Just remove the condition dt != '' .
DateTime dt = system.now();
if(dt != null) { // This line checks if datetime field is not null.
}
Example
DateTime dt = system.now();
if(dt != null && dt !='') { // This line gives error as '' is a string
}
Solution : Just remove the condition dt != '' .
DateTime dt = system.now();
if(dt != null) { // This line checks if datetime field is not null.
}