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
Sandy GaliSandy Gali 

Apex messages/ error messages on visualforce pages

Hi Guys,
       I built a visualforce page for Salesforce1 and want to display the validation error messages on the screen. I am not able to show any error messages/alerts on the screen and as a reason user would not know if the transaction was successful or not.

My VF page looks something like this:

<apex:page standardController="Account" standardStylesheets="false" sidebar="false" applyBodyTag="false" docType="html-5.0" id="mypage">
<apex:pageMessages />
<apex:form >
<apex:pageBlock >
Name: <apex:inputField id="field1" value="{!Account.Start_Time__c}"/>
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script>
    Sfdc.canvas.publisher.subscribe({name: "publisher.showPanel",
        onData:function(e) {
            Sfdc.canvas.publisher.publish({name:"publisher.setValidForSubmit", payload:"true"});
    Sfdc.canvas.publisher.subscribe({ name: "",
        onData: function(e) {
        alert("remote action here");
       Sfdc.canvas.publisher.publish({ name: "publisher.close",
       payload:{ refresh:"true" }});

        function getRemoteAccount() {
            // retrieve values here from the form

            '{!$RemoteAction.<apex class>.<method name>}',
             function(result, event){
                if (event.status) {
                    alert("Inside event"); 
                } else if (event.type === 'exception') {
                } else {
                      var  msg = result;
            {escape: true}

and I have catch block in my controller which does Apexpages.addMessage('message');

Any idea on how to display error messages when you are using submit in salesforce1 mobile and not the standard button