You need to sign in to do that
Don't have an account?
Developement
VF page is not showing the error
Hey,
I created this visualforce page. Page works fine.
Issue : Some fields are required on the page layout. It shows as Red mark. but when i hit save it doesn't show me the error on the field like below:
I want when i hit save it should show error like above on the fields that are required on the page layout. Here is the VF page:
Does anyone know how to fix it?
Thanks.
I created this visualforce page. Page works fine.
Issue : Some fields are required on the page layout. It shows as Red mark. but when i hit save it doesn't show me the error on the field like below:
I want when i hit save it should show error like above on the fields that are required on the page layout. Here is the VF page:
<apex:page standardController="Opp" extensions="oppsController"> <apex:sectionHeader title="Opp Edit" subtitle="{!Opp.OppNumber}"/> <apex:form id="frmId"> <apex:pageBlock id="pb" title="Opp Edit" mode="edit"> <apex:messages ></apex:messages> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}" rerender="theForm"/> <apex:commandButton value="Cancel" action="{!Cancel}" rerender="theForm"/> </apex:pageBlockButtons> <apex:pageBlockSection id="pb1" title="Opp" columns="2"> <apex:inputField value="{!Opportunity.Account_name__c}" required="True"/> <apex:inputField value="{!Opportunity.Active_Status__c}" required="True"/> <apex:inputField value="{!Opportunity.OppNumber}" required="True"/> <apex:inputField value="{!Opportunity.RecordTypeId}" required="True"/> </apex:pageBlockSection> <apex:pageBlockSection id="pb2" title="Details" columns="2"> <apex:messages ></apex:messages> <apex:inputField value="{!Opportunity.Opp_Country__c}" required="true"/> <apex:inputField value="{!Opportunity.Region__c}" required="True"/> <apex:inputField value="{!Opportunity.Sub_Region__c}" required="True"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Does anyone know how to fix it?
Thanks.
All Answers
But what about validation error message. when i hit save error comes in this form
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageMessages.htm
2. Surround your DML call with try {} catch(DMLException e) {} (When you catch the exception you won't get redirected to the error pages, but salesforce will automatically create a "PageMessage" for the validation failure.
@Deepak: could you please explain why rerender="theForm" was not working? Why have to remove that in order to make it work?