0

I know that this question covers the same subject, but the answers are not thorough enough, they just refer to the Salesforce documentation and that should be it.

But the documentation is not clear to me. It talks about Lightning Experience, custom buttons and links, but as far as I can tell, it is not possible to make a custom button or link visible on a Lightning Experience page layout. They are only visible in Classic. But please tell me otherwise in case I am wrong.

Another way of using the new URL is by making a Lightning component, which opens the URL with the given contents. I can get this to work with fixed values for fields, but the syntax that is used in the documentation only gives me errors. This is what I tried:

({
    doInit : function(component, event, helper) {
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url": "/lightning/o/Quote/new?defaultFieldValues=Name={!Opportunity.Name},OpportunityId={!Opportunity.Id}"
        });
        urlEvent.fire();
    }
})

It just gives me an error:

Looks like there's a problem.

Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 1031679058-147124 (-1922518417)

Can anyone give me an elaborated example on how to use this new feature?

1 Answer 1

1

I figured it out by myself, after some more googling. I found this page, which has an interesting section:

Is Map Location not showing up in the actions menu even though you added the custom button to the page layout? There’s a quirk to how custom buttons interact on page layouts with actions.

If you have overridden the default settings of the Salesforce Mobile and Lightning Experience Actions section of a page layout and customized it, the standard and custom buttons in the buttons section aren’t automatically included in the action menu on the page. You must add the buttons to the page layout as actions by dragging them from the Mobile & Lightning Actions category in the palette to the Salesforce Mobile and Lightning Experience Actions section.

And that was my problem. I had overridden the default settings of the Salesforce Mobile and Lightning Experience Actions section of the page, so the custom buttons were not visible, where they used to be in Classic. Once I followed the suggested actions, my custom button with URL contents:

/lightning/o/Quote/new?defaultFieldValues=Name={!Opportunity.Name},OpportunityId={!Opportunity.Id}

was visible and working!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .