1

After doing a bit of research, I have come up with the following code (I apologize if part of the code doesn't make sense).
I have created the following visualforce page

    <apex:page standardController="PVID__c" extensions="StandardController"> 
        <script src="/soap/ajax/29.0/connection.js"></script>
        <script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
        <script src="https://mobile1.t.salesforce.com/soap/ajax/30.0/connection.js" type="text/javascript" />
        <script>
        function myUpdate()
        {
        var accountId = document.getElementById('accountId').value;

        Visualforce.remoting.Manager.invokeAction(
        '{!$RemoteAction.StandardController.standardController}', accountId, function(result, event)
        {
         if(result!=null) sforce.one.navigateToSObject(result,"detail");
        Sfdc.canvas.publisher.publish({name: "publisher.close", payload:{ refresh:"true"}});

        });
        }
        </script>

        <apex:form >

            <h1>Visit</h1>
            <table cellspacing="20"> 
                <tr>
                    <td>Local Spaces</td>
                </tr> 
                <tr>            
                    <td style="padding:0 15px 0 15px;" ><apex:inputField value="{!PVID__c.Common_Areas_Text__c}" style="width: 300px; height: 50px"/></td>
                    <td style="padding:0 15px 0 15px;" ><apex:inputField value="{!PVID__c.Common_Areas_Rating__c}" style="width: 120px; height: 20px"/></td>
                </tr>     
            </table>

            <input id="photoFile" type="file" accept="image/*"/>

            <a href="#" data-role="button" onclick="myUpdate()">Save</a>

        </apex:form>
</apex:page>

My StandardController apex class

public with sharing class StandardController {
    public ApexPages.StandardController standardController { get; set; }
    public StandardController(ApexPages.StandardController standardController) {
        this.standardController = standardController;
    }
}

What I am finding hard to accomplish.

  1. Attaching a pic to my custom-object (PVID__c)

  2. By default, when you press back button on android Salesforce1 app, it closes. I want to navigate back to previous visualforce page.

Errors:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.