You need to sign in to do that
Don't have an account?

Error in validation rule
Hi Guys
I have created a validation rule like if one field blank then record would not be saved.its working but error message showing like this
Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Please fill the Value: [].
why this error message coming.i need the only error message Please fill the value.
AND(
Product_Code__c = "C2",
ISBLANK(No_of_ups__c)
)
How it is possible.
I have created a validation rule like if one field blank then record would not be saved.its working but error message showing like this
Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Please fill the Value: [].
why this error message coming.i need the only error message Please fill the value.
AND(
Product_Code__c = "C2",
ISBLANK(No_of_ups__c)
)
How it is possible.
If you are inserting records from standard UI then error message will be "Please fill the Value".
But if you are inserting records using apex code then the error will be like this "Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Please fill the Value: [].".
Mark it as solution if it helps you out.
Thanks
Naresh
IF(someField==null){
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.error,'Please fill the Value.'));
}
Mark it as solution if it helps you out.
Thanks
Naresh
try{
insert obj; //inserting/updating the record, which will fail if the No_of_ups__c is blank so it will go to catch
}
catch(Exception e){
obj.addError('Please fill the value');
}