8

For Visualforce pages the Standard New-Button created by <apex:detail> doesn't work correctly inside Visualforce containers on Flexipages.

Scenario:

enter image description here

I've put a Standard Visualforce Component on my Flexipage, pointing to a Visualforce page consisting of the following markup:

<apex:page standardController="elfBCProject__c" tabStyle="elfBCProject__c" recordSetVar="allItems"  >
    <apex:detail inlineEdit="false" relatedListHover="false" relatedList="true" showChatter="false" title="true" ></apex:detail>
</apex:page>

In my case it's for a Custom Object called elfBCProject__c - but you can use any Object for which a Flexipage is used.

Now inside that embedded VF Page most things work fine, but the Standard "New" Button for related lists has a crucial flaw: press it, and sforce.one beams you to the LEX-Version of the Record Create UI. So far, so good, but the Lookup towards the parent object is no longer populated as it MUST be, but it's just EMPTY:

enter image description here

Expected behavior would be like in Aloha:

enter image description here

Inspection of the button shows:

enter image description here

The reason behind all this is clear: LEX doesn't support the URL-hacking like this https://YOUR_DOMAIN.salesforce.com/a05/e?CF00N0Y000005N2De=10009+%E2%97%8F+Test+AG+Uwe+1+%E2%96%B6+2016+%E2%96%B6+2016&CF00N0Y000005N2De_lkid=a000Y000009Eggj&retURL=%2Fapex%2FtryPage_projectStdCtrl_tempUwe%3FsfdcIFrameHost%3Dweb%26isdtp%3Dp1%26id%3Da000Y000009EggjQAC%26sfdcIFrameOrigin%3Dhttps%253A%252F%252Fxe301-dev-ed.lightning.force.com&isdtp=p1

As an unfortunate, Salesforce uses these parameters in their Aloha code and the Link-wrapper injected for LEX-embeding plus the LEX UI for Creating Objects can't deal with that correctly now...

Does anyone know a quick and dirty workaround to fix this without the need of Flows or Actions? We have > 30 different Custom Object, and we only want to be able to create New objects in related lists. Creating Flows or Actions is a total Overkill for that. Using the Lightning Components for related list is unfortunately also not an option, because we are assembling many objects on one Flexipage (Standard Related List show only the one for the Flexipage-Record itself) and we need way more costomizability (e.g. Contacts as Card-Layout is just a show-stopper).

So how do we get the New-Buttons to life again... ?

Will Spring' 17 fix this? Summer'17? Or later? Or never?

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.