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
P.T.P.T. 

Display page layout with recordtype in Lightning Experience

Hello, we have an apex controller method that is called by a NEW button. We are using Lightning Record Pages. The controller redirects to a URL that is supposed to display a Case page layout that is assigned to a recordtype. The recordtype is passed in the URL, but the page still displays the default page layout. Can anyone give an idea why this is happening?

reType = cse.recordTypeId;
 returnURL = new PageReference('/500/e?nooverride=1&recordtype=' + rtype);
returnURL.setRedirect(true);
return returnURL;
MagulanDuraipandianMagulanDuraipandian
You have to pass &recordTypeId=IdOfTheRecordType.
--
Magulan Duraipandian
www.infallibletechie.com
P.T.P.T.
Hi Magulan, changed '&recordtype=' + rType to '&recordTypeId=' + rType, no change. The original solution worked in Classic when calling a VF page. I'm wondering if this can't be done in Lightning.