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?