+ Start a Discussion

setting Parent Id in sforce.one.createRecord

Hi All,

I am very new to Salesforce1 and currently working on one POC. Here I created one Object-Specific Action (using  custom VF Page) on "Account" object. This VF page will all list of Case RecordType name (just like regular record type selection page) with some custom filtering.

On selecting appriopriate Case' RT, I have to redirect user to Case creation page with prepost Account value, below is my sample code 

Please guide me, below is my code.

Thanks in advance!!

          function createServiceTicket() {
              var e = document.getElementById("{!$Component.form.CaseRecordTypeSelect}");
              var caseSelected = e.options[e.selectedIndex].value;
              var caseMainRT = '012i0000001IP0t';
              var caseSecondRT = '012i0000001IP0y';
              var selectedRT = null;
              if(caseSelected == 'Second RT') {
                  selectedRT = caseSecondRT;
              } else {
                  selectedRT = caseMainRT;
              sforce.one.createRecord("case", selectedRT);

<apex:form id="form">
    <apex:outputPanel id="FormPanel">
        <apex:outputLabel >Select Service Ticket Type</apex:outputLabel>
        <apex:selectList value="{!selectType}" size="1" id="CaseRecordTypeSelect">
            <apex:selectOptions value="{!serviceTktTypeItems}"></apex:selectOptions>
    <section class="data-capture-buttons one-buttons">
    <div class="content">
        <section class="data-capture-buttons one-buttons">
             <a href="#" id="createServiceTicket" onClick="createServiceTicket();" style="text-transform: none;" >Proceed</a>
Hi , 

See the links belwo for getting / setting parent ID in publisher actions, 



navigateToRelatedList(relatedListId, parentRecordId) Navigates to the related list as specified by the relatedListId. The parentRecordId is the record of the parent object. For example, for a related list of Warehouses, the parentRecordId would be Warehouse__c.Id.


See the usage of perent id: Salesforce1 Demo: Building an Expense Tracker


2) ParentId :- ID of the object type to which the is related. For example, set this field to a UserId to post to someone’s profile feed, or an GroupId to post to a specific Group.