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

Salesforce1 - attach photo to custom object and Navigation
I am new to Salesforce.
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="AccountController">
<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.AccountController.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 AccountController 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:

Any help is appreciated, thanks.
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="AccountController">
<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.AccountController.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 AccountController 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:
Any help is appreciated, thanks.