I am a beginner in Salesforce. I am trying to implement a code wherein user will get a alert message (some sort of notification ) when a field value is null. Although it will allow the user to save that record. I wrote a VF page. that I will embed with the standard page layout. Let me know if that is the correct approach.
<apex:page standardController="Opportunity" action="{!markread}" extensions="OppExtension">
<script>
if(!Opportunity.Country__c != null {
alert("Please fill in the country details");
}
</script>
</apex:page>
and my extension controller:
public with sharing class OppExtension {
ApexPages.StandardController controller;
public OppExtension(ApexPages.StandardController controller) {
this.controller = controller;
}
public void markread() {
Opportunity o = (Opportunity) controller.getRecord();
o.MessageShown__c = true;
update o;
}
}
