0

I'm new to Salesforce and i wonder how i can conditionally display visualforce page on account page upon that button click as illustrated on image . enter image description here

  • 2
    A modal showing VF would be a better option. You can do it easily using Quick Action – Pranay Jaiswal Jun 3 at 13:56
  • Thank you much for you reply ! , could you please clarify and whether i need lightening component to do so or not – Mahmoud-Abdelslam Jun 3 at 14:05
0

If you are in Lightning, There is a way you can set the visibility of the Visualforce page based on some condition.

You can use Visualforce standard Component in Lightning App Builder and select the visualforce page to display. After that, You can set the visibility on some criteria.

Component visibility properties appear when you select a component on a record, app, or Home page in the Lightning App Builder. This behavior applies to standard components, custom components, and components from AppExchange. No need to do anything to your custom components. It’s all handled by the Lightning App Builder.

enter image description here

You must enable "Available for Lightning Experience, Lightning Communities, and the mobile app" for a Visualforce page to make it available in the Lightning App Builder.

Refer the below picture to add Visualforce page on Your Lightning Page:-

enter image description here

and to set properties and filters:-

enter image description here

Read more here:- Dynamic Lightning Pages

  • Thank you much ! This really helped me . Is there any way to activate the component upon action button click ! . – Mahmoud-Abdelslam Jun 4 at 13:09
  • Yes, You can update some flag on click of button and set the visibility of your page according to flag. – sanket kumar Jun 4 at 13:17
  • I just thought for this too , to add a custom field for account object .and update it when i click that button . Worth-mentioning that this is a custom button as you know so is Javascript the only way to do this upon button click .? – Mahmoud-Abdelslam Jun 4 at 13:21
  • You can use flows or create a visualforce page and call it in your action or lightning component. Update the field onload of the component. – sanket kumar Jun 4 at 13:30

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.