0

I have a button on a Contact detail page, which leads to a report specific for the displayed Contact:

{!URLFOR('/00O58000004S13g', null, [pv0=Contact.Id])}

However, this does not work in Lightning, there it needs to be like this:

{!URLFOR( '/lightning/r/Report/00O58000004S13gEAC/view?fv0=' + Contact.Id )}

So how do I make one button that works in both Classic and Lightning?

1

The formulas that can used in button URLs allow for many things, making this expression possible:

{!IF($User.UIThemeDisplayed="Theme4d",
URLFOR('/lightning/r/Report/00O58000004S13gEAC/view?fv0=' + Contact.Id),
URLFOR('/00O58000004S13g', null, [pv0=Contact.Id])
)}

The button with this URL can be used both in Classic and in Lightning, which is quite useful when not all users can make the transfer to Lightning.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.