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

The error is not showing in my visualforce page
in my standar page my error is showing

but in my visualforce page when I try to save it is not showing

my apex
but in my visualforce page when I try to save it is not showing
my apex
public class FacturaRapidaController { public Factura__c factura; public Cobro__c cobro; public Factura__c getFactura(){ if(factura==null)factura=new Factura__c(); factura.Esta_seguro__c='Si'; return factura; } Public PageReference cancelarFactura(){ } public PageReference guardarFactura(){ try{ insert factura; } catch(exception ex) { return null; } PageReference FacturaRapidaPage = new ApexPages.StandardController(factura).view(); FacturaRapidaPage.setRedirect(true); return FacturaRapidaPage; } }my visualforce face
<apex:page controller="FacturaRapidaController" tabStyle="Factura__c"> <script> function confirmarCancelar() { var isCancel = confirm("Estas seguro que desea cancelar la creación de Factura?"); if (isCancel)return true; return false; } </script> <apex:sectionHeader title="Creación de" subtitle="FACTURA"/> <apex:form > <apex:pageBlock mode="edit" title="Crear Factura Contado"> <apex:pageBlockButtons > <apex:commandButton action="{!guardarFactura}" value="Guardar"/> <apex:commandButton action="{!cancelarFactura}" value="Cancelar" onclick="return confirmarCancelar()" immediate="true"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Información Básica de la Factura" columns="1"> <apex:inputField value="{!factura.Pre_Factura__c}"/> <apex:inputField value="{!factura.Sucursal__c}" required="true"/> <apex:inputField value="{!factura.Caja__c}" required="true"/> <apex:inputField value="{!factura.Serie__c}" required="true"/> </apex:pageBlockSection> <apex:messages > <apex:pageBlockSection title="Confirmar Factura" columns="1"> <apex:inputField value="{!factura.Pre_impreso_001_001__c}"/> <apex:inputField value="{!factura.Pre_impreso_002_001__c}"/> <apex:inputField value="{!factura.Pre_impreso_002_002__c}"/> <apex:inputField value="{!factura.Pre_impreso_003_001__c}"/> <apex:inputField value="{!factura.Esta_seguro__c}" required="true"/> </apex:pageBlockSection> </apex:messages> </apex:pageBlock> </apex:form> </apex:page>
please check below post for same.
1) http://www.sfdcpoint.com/salesforce/show-error-message-visualforce-page/
2) http://www.infallibletechie.com/2012/10/how-to-display-error-messages-in.html
3) http://www.infallibletechie.com/2013/04/how-to-add-error-message-in-visualforce.html
Please change your class like below:-
and page like below :-
Please let us know if this will help you
All Answers
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Datacloud_DuplicateResult.htm
please check below post for same.
1) http://www.sfdcpoint.com/salesforce/show-error-message-visualforce-page/
2) http://www.infallibletechie.com/2012/10/how-to-display-error-messages-in.html
3) http://www.infallibletechie.com/2013/04/how-to-add-error-message-in-visualforce.html
Please change your class like below:-
and page like below :-
Please let us know if this will help you
<apex:page controller="FacturaRapidaController" tabStyle="Factura__c">
<apex:messages />
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks