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
VarunCVarunC 

Why Standard “New” action link override in Salesforce1 having RecordType not working?

I've a Custom Object, and it has 3 RecordTypes. In my app, I've added an override for the "New" action link with a Visualforce Page.

Now in app (from desktop browser) the New button redirects and open RecordType wizard first, and then when clicked COntinue on screen, it opens my VF page.

In Salesforce1 app, when New button is clicked, it opens RecordType selection wizard page, but when clicked Continue, it opens my VF page "without" passing any RecordType selection value in the URL.

How do we tackle this in Salesforce1? I read the documentations, it says Link Overrides does not work in Salesforce1, but then why does it open our override when we clicked New button? I though since overrides are not supported in Salesforce1, it will simply detect and open Standard New interface part of Salesforce1 interface automatically.

Can anyone here suggest how to I make my New button work efficiently in both environments?
Ramu_SFDCRamu_SFDC
The below posts would definately help

http://salesforce.stackexchange.com/questions/24485/does-salesforce1-support-custom-buttons

http://salesforce.stackexchange.com/questions/28055/salesforce1-add-standard-actions-in-page-layout
SForceBeWithYouSForceBeWithYou
The Record Type selection page does not show up when you override the New action.  This has been the case long before Salesforce1 functionality come to the scene.  You must replicate that functionality if you wish to use the same type out-of-the-box.  For the standard UI, this can easily be done with a VisualForce page with a standardController, an apex:sectionHeader, apex:pageBlock containing an apex:selectList, and an apex:pageBlockTable for the list and descriptions of the record types.

For the Salesforce1 version of this, you would need to find or reverse engineer what it natively does if you override the functionality.

Here's an idea of it on Account:

NewAccount.page
<apex:page standardController="Account" tabStyle="Account" extensions="NewAccountController">
  <apex:sectionHeader title="New Account" subtitle="Select Account Record Type" />
  <p>Select a record type for the new account. To skip this page in the future, change your record type settings on your personal setup page.</p>
  <apex:form >
    <apex:pageBlock title="Select Account Record Type">
      <apex:pageBlockSection >
        <apex:pageBlockSectionItem >
          <apex:outputLabel >Record Type of new record</apex:outputLabel>
          <apex:selectList value="{!rtOptions}" size="1" required="true" />
        </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      <apex:pageBlockButtons location="bottom">
        <apex:commandButton value="Continue" />
        <apex:commandButton value="Cancel" action="{!cancel}"/>
      </apex:pageBlockButtons>
    </apex:pageBlock>
    <apex:outputText >Available Account Record Types
    </apex:outputText>
    <apex:dataTable value="{!rts}" var="rt">
      <apex:column value="{!rt.Name}"/>
      <apex:column value="{!rt.Description}"/>
    </apex:dataTable>
  </apex:form>
</apex:page>

NewAccountController.cls
public with sharing class NewAccountController{
    public List<RecordType>   rts{get; set;}
    public List<SelectOption> rtOptions{get; set;}
   
    public NewAccountController(ApexPages.StandardController ctrlr){
        this.rts = [SELECT Id, Name, Description FROM RecordType WHERE SObjectType = 'Account'];
        this.rtOptions = new List<SelectOption>();
       
        for(RecordType rt : rts){
            this.rtOptions.add(new SelectOption(rt.Id, rt.Name));
        }
    }
}

Cheers,

Nathan

Neha BapatNeha Bapat
Could you find a solution to this?