5

I added a new custom action with a visualforce page as the content. But it still has the cancel and save buttons at the bottom of the action. I'm trying to remove these as they do not make sense in my action. Here is the style I've tried adding to hide them:

.slds .modal-footer .slds-modal__footer {
    display:none;
}
.modal-footer .slds-modal__footer {
    display:none;
}
.slds-modal__footer {
    display:none;
}
.modal-footer {
    display:none;
}

Can I hide the footer or override the values in buttons?

3
  • I am a little confused with your title and description: is your quick action a visualforce page or a lightning component?
    – dsharrison
    Commented Oct 27, 2016 at 19:21
  • It's a lightning action, so you can add a button next to new, edit, delete, etc.. in lightning experience. When you click that button a modal pops up. You can create custom ones that use visualforce and that's what I'm trying to do. But since I'm making a custom visualforce page within the modal popup I don't need the cancel and save buttons that come standard on the modal popup. So I'm trying to hide those or at least change the value of those to something other than save and cancel
    – jmbauerful
    Commented Oct 27, 2016 at 19:42
  • 1
    Try setting showHeader and showQuickActionVfHeader to false: <apex:page showHeader="false" showQuickActionVfHeader="false"></apex:page>
    – Luke Galle
    Commented Jul 24, 2017 at 18:53

3 Answers 3

3

You will not be able to impact the styles of the action modal from your Visualforce because Salesforce uses an iframe to place your content. This is a security measure and is explicitly meant to stop you from stepping outside the bounds of your page (even if you are trying to do something harmless like hide the modal buttons).

If you are willing to convert your page to a lightning component take a look at the force:lightningQuickActionWithoutHeader interface which will allow you to make a component quick action without the header or controls.

Additional details can be found here.

Just to give a preview this is what an example looks like:

enter image description here

4
  • that's interesting, I wonder what is the point of having a save button on visualforce modal? The cancel and save button are there but the save is always greyed out when you have a visualforce page there as far as I can tell
    – jmbauerful
    Commented Oct 28, 2016 at 13:31
  • Is your visualforce page leveraging a standardcontroller?
    – dsharrison
    Commented Oct 28, 2016 at 15:39
  • No just a custom controller
    – jmbauerful
    Commented Oct 31, 2016 at 18:51
  • I have not tested this but it may be the case that those buttons will become enabled if you are using a standardcontroller because they can bind to the standard controller actions.
    – dsharrison
    Commented Oct 31, 2016 at 19:08
4

To hide the header, add showQuickActionVfHeader=“false” to the apex:page>

Document Link : Hide the Action Header for Visualforce Custom Actions

Example :

<apex:page standardcontroller="Account" extensions="AccountController" showQuickActionVfHeader="false" >

Thanks

Anup

1
  • 1
    This looks like correct answer.This helps with footer removal as well in Vf quick action
    – SEuser
    Commented Jun 13, 2019 at 13:32
1

The approach that I have used to make my own 'modal' is to useforce:lightningQuickActionWithoutHeader and after that, with a blank layout added 2 divs as follows <div class="slds-has-divider--top slds-m-vertical--large slds-grid--pull-padded-medium"></div> in order to divide my blank layout in 3 blocks which I can use as a header, body and footer. So, finally it looks something like this.

enter image description here

3
  • 2
    While this answer is a good start it would be more helpful it you posted your code or markup behind it.
    – Eric
    Commented Mar 17, 2017 at 23:09
  • This answer actually belongs someplace else, a good workaround - salesforce.stackexchange.com/questions/160535/… Commented Apr 14, 2018 at 8:30
  • @raul:Can you post your code for the above budgetary design screen shot. With that div , I am actually getting two scroolbar
    – Abhik Dey
    Commented Aug 27, 2018 at 7:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .