Questions tagged [commandbutton]

A button that is rendered as an HTML input element with the type attribute set to submit, reset, or image, depending on the <apex:commandButton> tag's specified values. The button executes an action defined by a controller, and then either refreshes the current page, or navigates to a different page based on the PageReference variable that is returned by the action.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Dynamically pass Action attribute to CommandButton in Visualforce Page

I am trying to assign action attribute dynamically to my commandbutton in Visualforce page. BUt, it gives an error. Below is sample code. VF page: <apex:commandbutton action={!mydynamicAction} />...
SFDC Developer's user avatar
1 vote
2 answers
87 views

Execute CommandButton Action Before JS Function (Without Controller)

SOLVED: See my answer below. I have a VF component on our opportunity detail page where users can enter input values on an apex form. There are multiple apex commandbuttons that produce another VF ...
acastro's user avatar
  • 46
0 votes
1 answer
46 views

Unable to find action 'deleteItem' on the controller of c:RosterLineItemCmp

I am am really new to the development console on SF but I saw a pre-set resources and was messing around with it to make a few action button. All worked except for the one that I edited to remove a ...
Rihco's user avatar
  • 3
0 votes
1 answer
242 views

Visualforce Page - Prevent onComplete With JQuery If Condition Does Not Meet

Folks, I have a button calling a function in JQuery and it has onComplete attribute. I want to check if the condition has been met or not , if not onComplete will not fire. Here the condition I want ...
Pam's user avatar
  • 97
0 votes
1 answer
238 views

How to disable command button before the action?

Please help! I need that the button "Save" to be inactive before the user changes the Status in position. I tried to do this with disabled="{! If (Status==null, true, false)}". ...
Oleh Shepard's user avatar
0 votes
0 answers
45 views

InputField can't be used with a commandButton that use rerender

apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute. This is the message I get when I press ...
Alexis's user avatar
  • 109
0 votes
1 answer
153 views

How to add a new button to the form of new opportunity?

this is the form where i want to add the "save & new quote" button .Is it possible to add a button to the New Opportunity flow? Once the form is felled , I'd like to have the option to ...
AYA ISMAIL's user avatar
1 vote
1 answer
1k views

align command buttons to center in Visualforce page

Command buttons have aligned to Right ,how to recenter them without using CSS? <apex:page standardController="Contact" lightningStylesheets="true" extensions="...
Purushothama Puru's user avatar
0 votes
1 answer
114 views

How to hide a button for sales manager profile in vf page?

How to hide this button for sales manager profile in vf page?pls help!! <apex:commandButton rendered="{!Order__c.Status_for_Eng__c!='Credit Check' || Order__c.Approved_for_credit_check__c=...
Learner Salesforce's user avatar
0 votes
1 answer
204 views

How to swap two values in visualforce page

In this visualforce page there are two inputs and one button. How to swap the values in given two inputs from input-1 to input-2 and input-2 to input-1. Please provide suggestions I tried the above ...
Hari nadh babu's user avatar
0 votes
0 answers
408 views

Pass Account ID Using URLFOR

I have a Visualforce Page that uses the standard Contact controller with a controller extension. The page is embedded on the Contact record layout and displays a related list of a custom object that ...
J. Neilan's user avatar
  • 1,223
0 votes
1 answer
687 views

Apex command button action executes even if the onclick button returns false

I have a situation where I need to open up a confirmation dialog as in the image, on the click of Save Update button. The button needs to check the value of the checkbox, if checked,only then open ...
Hara Prasad Sahoo's user avatar
1 vote
1 answer
69 views

unpackaged.zip getting in the way of pulling from scratch org

Hey guys I can't pull from my org because of this zip file Does anyone have any idea how to go about this I used the unzip command in command line, but that didn;t help.
mnoor01's user avatar
  • 21
-1 votes
2 answers
635 views

Apex command button onlick to open as a popup in Lightning

Can you please guide me to open a VF page as a popup on onclick event of apex:commandbutton as window.open is not supported in lightning. Thanks
Nagendra Ananda's user avatar
2 votes
1 answer
494 views

CommandButton & pageBlock title ignoring slds styling

I have a Visualforce page using slds styling, and some of it works and some of it doesn't. The pageBlock title does not have the shaded area around it - just displays the text in bold The ...
Irene's user avatar
  • 1,703
0 votes
1 answer
32 views

CommandButton action fails when selectList is populated

I have a visualforce page where I have a form with 4 separate selectLists with options populated based on different user groups. So far so good. This form also has a submit button which triggers a ...
Jeremy Canning's user avatar
1 vote
1 answer
368 views

Wrapper class data is not showing up in pageblock table after commandbutton action

Im having trouble getting a list from my wrapper class to show up in a page block table after clicking a command button. Can someone tell why my wrapper class is not showing up in the table? Is the ...
Matt P's user avatar
  • 13
0 votes
2 answers
373 views

Lightning cancel button in visualforce page

When cancel button is clicked in visualforce page, it has to redirect to home page.Instead I'm getting the same visualforce page.Kindly help. public PageReference cancel() { return null; }
user74320's user avatar
0 votes
0 answers
194 views

OnChange input picklist field page message is not showing

I am writing a VF page where my requirement is that I have a input picklist field. When I change the picklist value it is calling to controller method. And when in controller I have written a page ...
SFDC 44's user avatar
  • 664
0 votes
1 answer
342 views

Visualforce CommandButton Auto-Refresh Parent Standard Page on Page Save

I have a Visualforce (child page) stored within a Standard Page layout (Opportunity parent standard page) which calls a custom controller "Save" method. I would like for the parent page to refresh/...
FWSFDC's user avatar
  • 75
0 votes
2 answers
404 views

How to pass a param from command button to controller?

I am not sure what is wrong with my code, but I get a null as a value in the controller, once I click the button. I read a lot, and I think I am using the right tags, but still not working. VF Page: ...
Ivo Dimov's user avatar
  • 357
1 vote
1 answer
379 views

How to check which command button is clicked in apex

I have 1 command button and 1 command link which are calling same method "testGet" in action. How we can check which button is clicked in apex method? With command link, I am passing param which is ...
user71481's user avatar
0 votes
1 answer
49 views

Method updates all records inside <list> - should update only 1

I have implemented the following visualforce page on the lead layout: Here is the code: .hmk_top5table{ color:black; width:99%; font-family:Arial, Helvetica, sans-...
Jan Tonnet's user avatar
1 vote
1 answer
1k views

Updating Custom Object using Visualforce

I am trying to update fields on a custom object using visualforce. I have embedded a visualforce page on Lead Layout that displays records of my custom object linked to the lead. I want to update ...
Jan Tonnet's user avatar
0 votes
1 answer
119 views

How to include Find Duplicates standard button in visualforce page

I have a requirement to me include standard find duplicates button in the visualforce page like standard save & delete buttons. I have no clue either we need to create a custom button or there ...
Pavan tej's user avatar
  • 1,429
0 votes
1 answer
72 views

Displaying a list returned from a method on a Visualforce page

I've tried various iterations but this is what I have right now. This is the main code from VF Page: <div> <h3>Search Groups</h3> ...
ChristianA's user avatar
0 votes
2 answers
191 views

StandardSetController- the save and next don't work together but work as separate button clicks

I am using StandardSetController of the type QueryLocator for my solution. When I try to merge Save and Next together on Next button with Save being on action and next being on oncomplete JavaScript(...
Shaleen Yadav's user avatar
0 votes
0 answers
178 views

How to edit an element on a PageblockTable via Button

I have a list of products with their prices and I would like to be able to apply discounts to each product, but I'm not able to get the discount and the row number when clicking the button. I get an ...
Nora's user avatar
  • 1
0 votes
1 answer
84 views

How do I cancel a 'window.open' from a commandbutton?

I have the following CommandButton: <apex:commandButton value="View Statement" action="{!openInvestmentStatement}" title="View Statement" oncomplete="window....
Irene's user avatar
  • 1,703
1 vote
1 answer
231 views

Command Button not saving!

The command button on my Visualforce page is not saving edits to the record. Any help is appreciated! Visualforce Pg: <apex:page action="{!redirectToPartnerships}" extensions="EditExtensions" ...
FWSFDC's user avatar
  • 75
1 vote
1 answer
280 views

Apex command button does not work with Apex Repeat on Transient Varriable?

I am running into a strange issue, I've created the following function in my visualforce controller for testing: public void willFail() { Account acc = null; acc.Name = 'test'; update acc;...
Hans Donkersloot's user avatar
1 vote
3 answers
3k views

How can I get this button to pass data to controller?

UPDATE I have the following function: <apex:actionFunction action="{!selectRec}" name="recordSelectFunction"> <apex:param name="selectedID" assignto="{!selectedRec}" ...
Natalie Spatharakis's user avatar
1 vote
2 answers
397 views

Command button value with special characters

I have command button. I want display the button value as below : View the "Requested Items" Chart So i have tried. <apex:commandButton style="background:#d0a416; font-weight: bold;float: right; ...
jessy's user avatar
  • 29
0 votes
1 answer
994 views

How do I code a 'confirm send' button on my VisualForce page?

I have the following commandButton which runs the javascript function 'sendEmails'. This runs an ApexFunction which runs apex code to create and send an email from the controller. I need to add in a '...
Irene's user avatar
  • 1,703
1 vote
1 answer
1k views

Unintended Page refresh command button inside form

I have an apex command button inside apex form with it's action calling an apex pagereference method. This makes the page reload every time I click the button. Can someone please help regarding this? ...
Testing_SFDC's user avatar
  • 2,940
1 vote
0 answers
540 views

How to redirect to a different page from popup window in visualforce

I am displaying a popup window on visualforce page. My use case is to redirect user to a entirely different visualforce page after user clicks Yes button on popup. Currently, It just stays on the ...
Student's user avatar
  • 565
2 votes
1 answer
1k views

Visualforce Page Redirect from Cancel

I have a simple VF page embedded in the detail page of the Contract object. The VF page is designed to replace the standard buttons on the detail page since one of the buttons needs to only appear if ...
J. Neilan's user avatar
  • 1,223
2 votes
2 answers
1k views

Visualforce CommandButton Open in Existing Window

I am trying to overwrite the standard buttons on a standard object with an embedded VF page. The reason for this is that I want a custom button to be conditionally rendered based upon a field in the ...
J. Neilan's user avatar
  • 1,223
1 vote
2 answers
54 views

How Do You Prevent Action Repeat (i.e. Send Email Again) When VF Page is Refreshed?

If I send an email from my VF page - via inputTextArea, commandButton and MassEmailMessage - and then refresh the page, the email gets sent again. How do I prevent this? Please review my code below. ...
Gabriel Rivera's user avatar
0 votes
1 answer
757 views

How to call a javascript method from an apex method to display a button

I have a use case where I have a button "Add another". I want this button to be hidden until an apex method "Save" is called. The save method calls a javascript method which in turn displays the ...
Student's user avatar
  • 565
0 votes
2 answers
891 views

How to detect which command button is clicked?

I have 2 command buttons on my vf page: <apex:commandButton onclick="saveAndnewmethod()" value="Save and New"/> <apex:commandButton onclick="savemethod()" value="Save"/> and they call ...
Mae's user avatar
  • 339
0 votes
1 answer
599 views

apex:commandButton align center

How to move Button 'Create Referral' to center. I don't want that button on new Line. I want to show both Ok and Create Referral on same line, Ok on left side and 'Create Referral' to center <...
user46824's user avatar
0 votes
1 answer
329 views

How to align an image-button with another button?

I am able to create a commandbutton with image in visualforce page. But how to align it with another button? This is the current result: Here is the code <apex:outputPanel id="top" layout="block"...
Rival's user avatar
  • 569
2 votes
1 answer
2k views

Embedded VF page's refresh issue

This is an Embedded VF page on the standard Contact detail page. I am having a Command button on my VF page with following JS function: <apex:commandButton value="Click ME" onclick="jsFunction(); ...
Arnold Jr.'s user avatar
  • 1,490
0 votes
1 answer
1k views

Page redirection in same tab doesn't work with commandButton

I'm trying to get a button to open a standard record page in Salesforce classic view. I can get it to open in a new tab, but not in the same tab. I want to override the existing tab. Example of what ...
Avinash's user avatar
  • 2,061
2 votes
1 answer
2k views

Style and Show command Link as Command Button in Classic & Lightning

I would like a command link to look like a command button. I was once told that I could to that with using the style.
Chirag Mehta's user avatar
  • 1,281
3 votes
2 answers
4k views

How to disable a apex command button

In my VF page I want to disable the command button via Javascript(not through controller). <apex:page id="thepage" standardController="Opportunity" extensions="OpportunityExt"> <apex:...
Arnold's user avatar
  • 439
0 votes
1 answer
3k views

Apex Class for Extension AND Standard Controller Save Button

I have a visual force page using an extension and the standard controller. I added a pagereference save() action to the page but it is only updating the child and grandchild records. How can I get ...
user51949's user avatar
0 votes
1 answer
200 views

Apex:ActionRegion blocking Controller function Action

I'm trying to call a simple function in my Apex Controller and want to use an actionRegion to stop most sections of the page re-rendering. I note though when I add the actionRegion the controller ...
RedQueries's user avatar
0 votes
0 answers
463 views

pass variables into command button

I have a command button which has an action status and param values .please see code below <apex:commandButton id="songdbabc" action="{!synchsongmethod}" immediate="true" status="...
Natasha's user avatar
  • 127

1
2 3 4 5