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?

  • I am a little confused with your title and description: is your quick action a visualforce page or a lightning component? – dsharrison Oct 27 '16 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 – Joe Bauer Oct 27 '16 at 19:42
  • 1
    Try setting showHeader and showQuickActionVfHeader to false: <apex:page showHeader="false" showQuickActionVfHeader="false"></apex:page> – Luke Galle Jul 24 '17 at 18:53
2

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

  • 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 – Joe Bauer Oct 28 '16 at 13:31
  • Is your visualforce page leveraging a standardcontroller? – dsharrison Oct 28 '16 at 15:39
  • No just a custom controller – Joe Bauer Oct 31 '16 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 Oct 31 '16 at 19:08
2

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

  • This looks like correct answer.This helps with footer removal as well in Vf quick action – Kaushik Ray Jun 13 at 13:32
0

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

  • 2
    While this answer is a good start it would be more helpful it you posted your code or markup behind it. – Eric Mar 17 '17 at 23:09
  • This answer actually belongs someplace else, a good workaround - salesforce.stackexchange.com/questions/160535/… – Jitender Padda Apr 14 '18 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 Aug 27 '18 at 7:35

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.