function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lee Anne GLee Anne G 

How pass parameter to Apex controller from VF page without rendering the page?

Hi, I'm trying to replace our javascript buttons in Lightning. 

Here's what I want to do:
Have a button on a related list (opportunity items). When I click the button, it calls a visualforce page, that has the action parameter in the apex:page section calling a method in the extension that sets the discount type. It works great. The last thing I need to do is be able to pass a variable/parameter to define the discount I want applied so I can use the same controller extension for all three discount types. 

I don't want the user to even know they are calling a VF page. Just that they're clicking a button that says : "Apply DOD Discount" and that discount is applied to all the items they have selected.

There doesn't seem to be a way to do this.
 
GovindarajGovindaraj
Hi Lee,

Did you try 'Onclick Javascript' option in the custom buttons instaed of calling VF page.

FYI : Onclick Javascript buttons will not work in Lightning

Thanks,
Govindaraj.S
Lee Anne GLee Anne G
Hi Govindaraj, I am replacing Javascript buttons for lightning. I already have them working as javascript buttons in Classic.