1

We've got a button that just redirects a user to an another website with some parameters on a record page.

The business asks us to validate the record(making sure that some of the fields are not blank and have certain values) before redirecting the user.

In Salesforce Classic I would create a JS button, where I would validate the record and then redirect the user(or just show an error). In Lightning Experience, JS buttons are not supported.

What would be the best way to achieve the business request? The only Idea I've got rn is to create a quick action that opens Aura component, where I validate the record and then redirect the user the url. Which is kind of inconvenient, because quick action + lightning component would always render a panel.

1

You can close the panel as soon as it opens with force:closeQuickAction. This also gives you an opportunity to display an error to the user if the URL cannot be opened because validation fails. In the future, it may be possible to have a button without a modal appearing (see this question), but there is no ETA on this feature that I'm aware of.

1
  • I already do it, but that's not the best UX - the users see the tab popping, which I, ideally, wanted to prevent. Looks like it's the only option, though. – Curious Squirell Jun 15 '20 at 15:56

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.