Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
Salesforce custom button should show in lightning not classic

I am trying to add a link to redirect from opportunity page to a vfp page. There are two pages one for classic and one for lightning. I want to add two links. If user is in classic mode one button will show and for lightning the other button will show. Is it possible with javascript or apex?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I would suggest using a Detail page button to redirect on your page. After creating your button you can edit the page layout and add your newly created button to both lightning and classic page layout enter image description here I think that for your use case 2 buttons are needed, one to redirect in lightning and one to redirect in classic.

Otherwise, if you want to have a conditional link with Javascript you can try something like(I have never tested this though, so I'm not sure it's working):

if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {
     // Do something for Lightning Experience
} else {
    // Use classic Visualforce
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!