function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sonisha ssonisha s 

Can someone please help me with what's wrong here!

I have a validation rule written on one of my custom objects, which needs to fire on edit of records on the vf page.
SCENARIO:
--> the validation error msg needs to popup on meeting the below rule on edit of records.
--> also after which if i enter the Complaint_ID__c  and try to change the status to closed and save it isn't happening. neither the error msg is shown nor the upsert happens the record goes back to how it was before the edit.
--> the validation runs but states UPSERT failed on the logs.
this is how the validation looks, 
AND(
OR(Escalation__c ='EM6' ,
AND(Escalation__c ='EM7', Escalate__c =true)),
ISBLANK( Complaint_ID__c )=true,
ISCHANGED(Status__c),
ISPICKVAL(Status__c,'Closed')
)
ANUTEJANUTEJ (Salesforce Developers) 
Hi Sonisha,

As per the answer in the link: https://salesforce.stackexchange.com/questions/111803/any-standard-functionality-to-popup-error-message-on-validate-fields

It is stated that "With the standard functionality you can`t create popups. If it is important for you to have a popup you will have to use javascript on that button or create a visualforce page.
However if you just need to display an error near a field or on the top of your page standard validation might work for you like that:
OR( ISBLANK(field1), ISBLANK(field2), ISBLANK(field3) )"

I hope this was helpful and in case if this comes handy can you please choose this as best answer so that it can be used by others in the future.

Regards,
Anutej