Questions tagged [onclick]

The tag has no usage guidance.

0
votes
1answer
26 views

Refresh lightning:tab on change

I Built a lightning component which is used in opportunity layout. This component used some child component as lightning tab. The problem is when I edit and change some value in first tab is not ...
2
votes
1answer
29 views

Getting error function not defined while it's there

I need to call the jsPdf function, however in the console I am getting genPdf is not defined. Here is my code-- <apex:page controller="GenerateQuoteController" standardStylesheets="false" ...
0
votes
1answer
2k views

Lightning OnClick Not Working Within aura:iteration

I've been unable to get onclick actions to work in my organization when the onclick element is within an html <aura:iteration> tag. The onclick action works when I put the <a> tag or <...
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 ...
0
votes
2answers
442 views

event.target.value returns [object object] on onClick

component pseudo code <aura:iteration var="PIW" items="{!v.objInfo}"> <thead> <tr> <th> <button ...
0
votes
2answers
32 views

Passing argument to onclick event

I am dynamically creating HTML <div> and I need to handle the onclick event : when the user clicks on it, I want to call a controller function and this function requires an argument. How do I ...
0
votes
1answer
49 views

Dynamic DOM : firing event on click

I am dynamically creating some DOM elements inside my component's controller and adding them to the page. I need to set the onclick event on these elements to call another controller function that ...
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
0answers
210 views

Dynamically created HTML : link onclick to Controller function

I'm creating some HTML elements in a helper function, and dynamically appending them to the DOM. There is no problem in this step. The only problem I can't solve is the creation of the onlick ...
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: ...
1
vote
0answers
172 views

Get event source from onclick handler in outer div

In my lightning components, I am trying to create a system that keeps track of every button that gets clicked inside my component. Having an event that fires whenever any button is clicked turns out ...
0
votes
1answer
61 views

Reference a controller function for a dynamically created DOM element

In my helper, I have a function that is dynamically creating multiple . I want the onclick event to trigger a controller function : I tried the following code : accordionWholeDiv.setAttribute('...
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 ...
0
votes
0answers
313 views

Lightning component navigatetoURL to open Lightning App Page

Using Aura:component with figure onclick to open URL which is another Lightning App Page. Cannot get the URL syntax correct. It's a managed package so will have different MyDomains. The Lightning App ...
0
votes
2answers
306 views

OnClick Java Script - reload child records

I have a detail page button that is currently calling an APEX class. After the class has executed I am reloading the page that the button was clicked on. Is there anyway to also reload related lists/...
2
votes
0answers
232 views

New button pop is not showing to create new record in Lightning

i am new to lightning and trying to learn lightning. i have created component in that component i am showing the contact based on the accountid using (implements="flexipage:availableForRecordHome,...
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
2answers
1k views

How to pass map<string,string> as parameter in javascript

I have a method : webservice static String myMethod(String objectType, String recordId, Map<String,String> fieldValueMap ) I need to pass this in onclick javascript custom button. sforce.apex....
0
votes
0answers
355 views

onclick event not working on dynamically created <li>

I have a component where upon aura:iteration (data loaded from server onInit), other components are created (list items of an SLDS lookup). The issue I have is, the onclick on the LI does not fire ...
0
votes
2answers
447 views

Onclick javascript button - how to enable and disable based on profiles

Onclick javascript button - how to enable and disable based on profiles. For example the button should be displayed based on no of days created , if more than five weeks the button should be visible ...
2
votes
2answers
1k views

Action failed: lightning:button$controller$handleClick [d.run is not a function]

I have a lightning component called modal which is used in another component called Split, the modal takes an array of buttons to render them (and does some more) I have a working version of it in ...
0
votes
1answer
1k views

Aura Iterate, get the aura:id of a span

I'm trying to get the ID of an element that is in a loop to trigger an event, but I can't get the ID nor content of the tag. I've done something similar on visual force pages, but I did it ...
0
votes
1answer
66 views

Nested IF statements on a button's onClick

I am working on a custom Visualforce page where I have requirement for a button to function based on a criteria. This working good: <apex:customButton onclick="{!IF(OR(c.first, c.second), '...
2
votes
1answer
34 views

OnClick Javascript button error when merge field value is “St. John's”

I'm working with a Detail Page Button that executes OnClick Javascript. Most of the time it works just fine. However, in this particular instance, one of the merge fields in the script has a value of "...
0
votes
0answers
326 views

<input type=“radio” returning ON with onclick function

To my previous Question, I did some more debugging and ended up log with OnClick value: on Good thing is, I have my LightningApp on the Internet Explorer which helped to get to the console logs(...
2
votes
1answer
978 views

OnClick JavaScript Button, Invalid or unexpected token error

Here is the field I am trying to update, the far left is the picklist I am wanting to update. the field on the left is another picklist. both lists have the same values. As you can see below I have ...
0
votes
2answers
2k views

lightning dynamic component datatable onclick/onrowselection

I have a lightning component that dynamically creates a lightning:datatable when apex returns a list of records. For the most part its working, but im trying to add an onclick event to the row, but ...
0
votes
1answer
170 views

If Condition for onclick not working

I am looking for a way to insert a record and close the window with the VF-Page, when everything was entered correctly and user clicks button. The values are entered correctly, if a subject was ...
0
votes
1answer
675 views

Update controller variable from visualforce button/div onclick

I am having issues with my visualforce page refreshing everytime I perform an onclick action? Any ideas public without sharing class LMS_CaseNewEditController { public Boolean recordClicked ...
0
votes
2answers
63 views

onclick Javascript failing to pass If Condition

What could be wrong with this code? I'm fairly new to javascript and I've been trying to debug on my own to no avail. The alert('confirmed: ' + records[i].ENQ_Confirmed_with_Enbridge__c); shows ...
1
vote
1answer
497 views

Making a checkbox field value null using a JS function

I am trying to set the value of a checkbox(custom field) to null in a VF page using Javascript function.Below are bits and pieces of my code. This happens when the user clicks the tag. An Onclick JS ...
1
vote
1answer
2k views

Cannot read property 'value' of null in this case

I am trying to get the value of a text field in a VF page in Java Script. Below is my VF page. <apex:page id="thepage" standardController="Opportunity" extensions="OpportunityExt"> <apex:...
1
vote
2answers
226 views

Call Record's JS onclick button from a VF page

I have created a custom button on a record that calls onClick JS to update the record. I would like to call the same JS button's function, from a VisualForce page. The purpose for this is so that I ...
0
votes
2answers
98 views

Invalid left hand side in custom Javascript

I'm trying to edit a custom OnClick JS button which creates a PDF from a quote, provided the quote passes certain checks. this code works: {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} var q = ...
2
votes
1answer
2k views

CommandButton oncomplete JS function not firing [duplicate]

I have run into an issue with an apex:command button, where the oncomplete part of the process is not being called, and prevents the button from completing its action. The VF page is a component on a ...
1
vote
2answers
3k views

Adding onclick to dynamically created button

I have a component that dynamically creates buttons which, when clicked, apply filters and then re-query the back end for data. While I can assign onclick events to each button, I can't find a way to ...
0
votes
1answer
481 views

Updating a record, and related record using a custom button

I am trying to build an onClick JS button on a custom Object called Application. The button is designed to update 2 fields on the the Application, and a related record's field on the Opportunity ...
0
votes
1answer
34 views

How can I reference an installed pkg VF page in an OnClick Javascript Detail Button

I need to update this hardcoded url before an instance refresh and I am having difficulties finding a solution. The VF page is from a managed package that has the namespace of scl I have tried to ...
0
votes
1answer
257 views

value outside of valid range on numeric field: NaN

I want to track how many times a user clicks on a certain button called Reject. So I created a counter field that will be updated whenever the Reject button is clicked. The counter I created is called ...
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 ...
0
votes
1answer
155 views

how to show my selected pick list value using on click function?

i have one VF page in that i have one Pick list value while clicking next button it should show my selected pick list value like You have rated location name good/average/low/excellent". Here is my ...
0
votes
1answer
298 views

Button: How to Add a Number value to SF number field

Goal: A user should expect to increment a custom object's (number type) field by 1 each time the custom button is clicked. Initial block: {!REQUIRESCRIPT("/soap/ajax/37.0/connection.js")} ...
0
votes
1answer
648 views

“sforce.connection.insert is not a function” error

I am creating a button which creates new record in another object, i am using following javascript code var curnc= new sforce.SObject("TR_Currency_Approval__c"); curnc.Name="{!TR_Currency__c.Name}";...
0
votes
1answer
154 views

onClick Exectue Java script for SF button error Invalid or Unexpected Token

Here is my code in the button: if({!NOT(ISPICKVAL(SVMXC__Service_Order__c.SVMXC__Order_Status__c, "Closed"))}){ alert("Close Work Order button has not been completed, the Work Order Order Status ...
2
votes
2answers
9k views

Using action and onclick together on command button

I have to call an apex function only when javascript validation passes. Hence,initially I tried the below code: <apex:commandButton value="Submit" onclick="return addDomain();" action="{!...
2
votes
2answers
503 views

How to get all buttons in my page from a controller javascript function(component, event, helper)?

I know how to enable the clicked button. Lets say I want to enable all buttons on the click of a button. The button is in a Lightning component as: <aura:component implements="flexipage:...
1
vote
1answer
118 views

On-Click Button: Why is Salesforce passing in 'undefined' string value?

I am trying to auto-insert an array of Tasks based on the Accounts selected in the Account 'List View' tab. The tasks are inserting as expected, but instead of writing the Account Name in the subject ...
0
votes
3answers
95 views

Onclick Javascript fails identify Resultset

I have below code where I get a run-time error as 'Unexpected Identifier'. My Resultset is not getting evaulated properly. Can someone please help? Onclick Javascript code in Detail Page button {!...
0
votes
1answer
628 views

If statement fails in Onclick javascript button

I have below code where if statement that needs to work based on 'check' boolean value, is not working properly. Although, 'check' value is true it navigates to the else block. Can someone please let ...
0
votes
0answers
260 views

Added Onclick Java Script Alert into Detail Page Button

I am encountering some issues and it has me stumped, and hoping the community can help me out. The aim here is that when the user pushes the custom button an alert should pop up saying: "By ...