I have an apex extension and VF page, as an override to the New link on a custom object, that does something I would think is pretty standard. For a new record, it checks the RecordType coming in from the URL and returns a different view depending on the record type. Conceptually, like

if (ApexPages.CurrentPage().getParameters().get('RecordType') = '012....') 
    return new PageReference('SomePage');
else return new PageReference('SomeOtherPage');

Which is fine until I put the page into Salesforce1. Because in Salesforce1, ApexPages.CurrentPage().getParameters() returns a different set of values.

In normal browser UI, the map contains

{RecordType=012i0000001AXw6, ent=01Ii0000001oJDs, 
  retURL=/a0N/o, save_new=1, sfdc.override=1}

because it's just come off the record type selection page, so it has RecordType and ent.

When the same code runs In Salesforce1, I get the record type selection page, then I'm redirected to my VF, where the map looks a bit different:

{isdtp=p1, nonce=52409e8a3dd9f5289e71c077c88c92422940a5c34ea2585243ef3ea6119d5236,     
save_new=1, sfdc.override=1, sfdcIFrameOrigin=https://cs15.salesforce.com} 

How can I read the URL parameters like RecordType? where are they?

  • 1
    If you don't have the page enabled for SF1. then I'd expect you'll likely need to create a flex page to use in it's place. Also, it almost sounds as though you could get the same functionality using either an object or global action depending on the context. – crmprogdev Nov 27 '14 at 16:01
  • @dougchasman Any ideas how to get the URL parameters when the VF page is rendered in SF1? I want to know what RecordType was passed in by the RecordType selector – Dominic Nov 28 '14 at 14:46

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.