Questions tagged [onclick]

The tag has no usage guidance.

4
votes
1answer
751 views

Validating sObject fields in JavaScript Custom Button?

I have a button that should update a boolean field to true if certain conditions are met. I want to do my validation in the JavaScript that fires on button click instead of letting the system run ...
2
votes
1answer
7k views

Apex Command Button using action and onclick not working

What I'm trying to do is have an Apex command button that on the click opens a new VF page and also, have an action that does some backend query to get data ready for the popup VF page. Not sure why ...
0
votes
1answer
129 views

commandbutton on a vf page inside a section

I put a "new " button inside a vf page and after I inserted that vf page inside a section on the Account page layout. When a user click new, has to be redirected on the custom Object Referente ...
3
votes
2answers
2k views

Visualforce: Checkbox is not firing function onclick

I've tried everything I can think of to get this checkbox to work. This code is just supposed to trigger a function when a checkbox is checked. It currently does not trigger the alert, it only "...
0
votes
2answers
542 views

Adding One Year to Date Field Value Through Custom Button

I'm going through one of the Force.com workbooks and attempting to add some functionality to a Date field using a custom button. On click, I want to button to update the appropriate field by moving ...
0
votes
2answers
10k views

Run javascript when clicking button on vf page

Previously I had a custom button on a custom object and I set behaviour to "execute javascript" and content source to "onclick javascript". {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} {!...
3
votes
3answers
17k views

Refresh Page After OnClick

I have a custom VF page acting as a button. When the button is refreshed, a checkbox is either checked or unchecked. All that works fine, but I cannot figure out a way to reload the page after the ...
1
vote
2answers
4k views

Confirm Dialog Box On Detail Page

I wanna add a custom button (Send Mail) on contact detail page, And is email field is having an email then on click he ask with a popup "Wanna send a mail ?" And wanna add 'Yes' Or 'No' instead off '...
1
vote
1answer
348 views

Custom button on list view limitations

I have a custom button on my accounts list view to change the record from the current owner to my ownership using OnClick Javascript. I have admin privileges and when I use the button it succeeds in ...
1
vote
1answer
1k views

returning Javascript onclick prevents button from using it's action

The action part of my button stops working as soon as I change my button to return my javascript confirmation. Javascript: function confirmDialog() { var confirmation = confirm('Once you submit ...
1
vote
2answers
863 views

Call Public class method from onclick javascript [duplicate]

I have a public emailing apex class I need to call that from onclick javascript button of a detail page. Can someone let me know , if I can do that? Please give me an example. I am not getting it. I ...
1
vote
2answers
286 views

Insert record to a different object cloning data from detail page

I have a custom detail page button to run OnClick Javascript on custom object Form_Requests_abv__c. On this button click it should do two operations. 1. Create a new Sample_Order_Form_abv__c record ...
2
votes
1answer
432 views

VF Page on-click events for HTML elements

I have a checkbox on my VF page, with the label in a <TD> element of the table, and the checkbox in a <TD> element next to it like this: <tr> <td class="LeftColumnTop W50" ...
2
votes
2answers
435 views

Custom Onclick Javascript button query

Today we got a notification from Salesforce to remove scripts from home page components and put them in Visualforce areas. Eventhough we are not impacted by this specific notification, I am just ...
1
vote
1answer
311 views

Query on Javascript get error Malformed_Query

I create list button OnClick Javascript Button on Lead. it will update the Is_Picked__c checkbox on selected record whenever i click the list button. but i still get MALFORMED_QUERY. Any thoughts? {!...
2
votes
2answers
225 views

Javascript button visibility depending on a variable

I have the following piece of code <td width="10%"/> <td width="80%"><input type="checkbox" name="checkbox-mini-1" id="checkbox-mini-1" data-mini="true" onclick="javascript: ...
4
votes
4answers
6k views

Preventing a reload/refresh on form submit in Lightning

i have created a form in salesforce lightning using form tag and one button there is inputtype="submit", value="submit", i dont want to reload the page when submit clicked. please help me out. <...
0
votes
1answer
486 views

Object Custom Link OnClick JavaScript check if page exists before window.open

I have a link on an object that contains code similar to the following. var VFBase = "/apex/MyVFPageName_"; var DBFld = "{!MyObject__c.MyField__c}"; var Suff = "?id={!MyObject__c.Id}"; var VFFull ...
0
votes
1answer
3k views

Custom button that will open a popup to select from a picklist

I have a requirement to create a custom button that will open a pop up window with some options to select. Currently i've built a VF page and called it from the custom button. But i need to expose ...
0
votes
1answer
556 views

Onclick javascript button click show available records of custom object

I have a requirement to have a custom button on Account detail page. A click on that should show all available records for logged in User of a custom object Approved_Documents_vod__c. This object has ...
0
votes
1answer
385 views

OnClick Javascript Button causing error on field with separate lines.

In the button code, the line dog.colMrk__c = "{!Birth_Record__c.Characteristics__c}"; causes an error "Unexpected token ILLEGAL" when there are separate lines in the Characteristics field. Is ...
-3
votes
1answer
1k views

OnClick function in HTML is not working with AJAX call [closed]

<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> .bor { border-color: blue; ...
5
votes
1answer
10k views

OnComplete Javascript to pop up alert and Redirect to a record page

I'm stuck with onclick and oncomplete. looking for a solution on this. I have a controller that simply saves a Case record. I want to display a Message to User that 'Your case is saved with {!caseId}...
2
votes
0answers
822 views

How to display alert pop up for inserted record Id and redirect the VF page to another VF page

I have a custom VF page 'HOMEPAGECOMMUNITY'. I would like to Navigate to 'LANDINGCOMMUNITY'. I have a commandButton 'Submit' which is associated with couple of Rerender Id's for PageErrorMessages and ...
0
votes
2answers
928 views

How to execute the standard Onclick Javascript code from Detail Page Button in a Visualforce Page?

I've a custom button in the detail view of the object (type is onClick Javascript). I have a visualforce Page where I'm trying to replicate the same functionality done through the Onclick JS button in ...
0
votes
1answer
154 views

Javascript Message show on List button click for a profile

I have a requirement to show a javascript pop-up that 'U r not allowed' when a particular profile Users click on the List button. For the rest of the profiles , I have a landing VF Page to deal with. ...
-2
votes
1answer
499 views

use javascript function in list button onclick javascript

In a List button, i execute javascript code, and for this i defined a static resource where i implemented some functions and i included my resource this way : {!REQUIRESCRIPT('/resource/...
0
votes
3answers
218 views

Custom Button to send email no working

I did create a custom button(OnClick JavaScript) to send an email. It is working fine with system admin. But when I did deploy it in production the users with profile other than system admin ...
1
vote
3answers
5k views

Salesforce Custom Button OnClick Javascript - Create multiple child record

I have Error for my custom button javascript for create multiple child record. my code is: {!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} //identify ...
1
vote
4answers
764 views

Custom send email button: Only send once

I've got a fantastic OnClick JavaScript button set up which will check if two fields are the same and populate the to/cc fields on an email template accordingly. Now, however, I want to somehow ...
2
votes
2answers
1k views

How to Call two action from one Command Link? [duplicate]

I have to call 2 URL on click of command Link , one will Record Edit Page URl and Another is different Webserver URl I have tried two Ways Both are Not Working.....I mean both action is Not ...