You need to sign in to do that
Don't have an account?
kjun
Salesforce1 Quick Actions and remoteObjects, picklist
Created a custom quick action button and visual force page for SF1, I want to add a picklist to my form, how can I achieve this?
Does this syntax look correct for creating a picklist onto my form using the Account "RecordTypeId" label?
Also what is the syntax to place the picklist onto the form, I have the syntax for the Account Name correct (<input type="text" id="accountName"/>), but I can't figure out the syntax for a picklist.
This is my entire VF code in case you need to review it.
Thank you in advance!
Does this syntax look correct for creating a picklist onto my form using the Account "RecordTypeId" label?
Also what is the syntax to place the picklist onto the form, I have the syntax for the Account Name correct (<input type="text" id="accountName"/>), but I can't figure out the syntax for a picklist.
<apex:remoteObjects > <apex:remoteObjectModel name="Account" fields="Id,RecordTypeId,Name"/> </apex:remoteObjects> <div class="mypage"> Account Name: <input type="text" id="accountName"/> <button onclick="createAccount()">Create Account</button> </div>Here's a screenshot of the rendered page within SF1:
This is my entire VF code in case you need to review it.
<apex:page docType="html-5.0" title="Create Account"> <style> .mypage { font-family: "ProximaNovaSoft-Regular", Calibri; font-size: 110%; padding-top: 12px; width: 100%; } .mypage input[type=text] { width: 100%; height: 35px; -webkit-appearance: none; padding: 0 8px; margin: 4px 0; line-height: 21px; background-color: #fff; border: 1px solid #ddd; border-radius: 3px; outline: none; } .mypage button { -webkit-appearance: button; border-radius: 3px; display: block; padding: 12px; margin: 4px 0; width: 100%; background: #eee; border: solid 1px #ccc; } </style> <apex:remoteObjects > <apex:remoteObjectModel name="Account" fields="Id,RecordTypeId,Name"/> </apex:remoteObjects> <div class="mypage"> Account Name: <input type="text" id="accountName"/> <button onclick="createAccount()">Create Account</button> </div> <script> function createAccount() { var accountName = document.getElementById("accountName").value; var account = new SObjectModel.Account(); account.create({Name: accountName}, function(error, records) { if (error) { alert(error.message); } else { sforce.one.navigateToSObject(records[0]); } }); } </script> </apex:page>
Thank you in advance!