Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

Javascript is a weakly typed interpreted programming language primarily implemented by web browsers to allow for client-side scripting. It can be used in Visualforce pages to give a more dynamic experience to end users. Additionally, the Visualforce engine generates and uses JavaScript to support the functionality of some of its components.

-1
votes
0answers
10 views

How to call one method after another in wrapper class?

I Have a lookup based on that value selected i have to query and get the select options. I am trying to call the wrapper class but its throwing me null pointer error.guide me where i am going wrong. ...
0
votes
1answer
23 views

How to rerender specific row independently for picklist values

I want to render picklist values based on each row when lookup is selected. There is a filter where it checks the recordtype of the lookup and based on it picklist value will be displayed. The problem ...
0
votes
1answer
18 views

How to currentdate.getDate() in JavaScript for Lightning Web Component?

I'm trying to write a test class to automate my several tests in register forms, but the JavaScript currentdate.getDate() isn't working for some reason that I don't know. I'm trying the following: ...
0
votes
0answers
9 views

Multiple recordEditForm forms field value check

I have a requirement that must replace the functionality of a third-party software in which a list of opportunity team member roles must all be assigned in a single screen. To accomplish this, I have ...
-1
votes
2answers
23 views

Disclaimer Popup on Chatter Group [on hold]

I want to add a disclaimer message on a chatter group. When new user join chatter group he/she needs to accept disclaimer message. Can anybody help me on this because there is no standard way to do ...
0
votes
0answers
17 views

how to conditionally render a gauge chart based on values of a numeric array in Visualforce

controller--snippet if(pos >=0 && pos <assTElist.size()){ lstTrans = [select Maturity_Assessment_Question_ID__r.Transformation_Element__c fa, ...
4
votes
1answer
425 views

How to add a functionality to stop copy paste on an input field in lightning?

I'm making a form that includes two fields, Email and Re-Enter Email. I don't want the user to copy and paste the email id in the second field. I have to prevent right clicks on the re-enter field and/...
0
votes
2answers
26 views

Second apex method executing before the first one finishes

I have a vf page displaying several Multi select custom buttons. And I am calling a apex method every time one of the button is clicked from VF page using actionfunction. But if I click 2 buttons in ...
0
votes
0answers
8 views

Filetype error in community, only happening in sandbox but not in Production

I am receiving below error when I am trying to upload a .FNM file in my community. No code has been changed but it is working in Production with same code but not in sandboxes, does this have ...
0
votes
1answer
24 views

Can we blink a primary tab after opening it via any css or js?

I am trying to open a primary via this: sforce.console.openPrimaryTab(null, '/lightning/n/***', true, 'TestSearch', openSuccess, 'salesforceTab'); Now if I pass false, the tab opens and does not ...
0
votes
0answers
16 views

lightning:input press enter and hide mobile keyboard

I have a <lightning:input which is used to search for products. CMP <lightning:input onchange="{!c.handleSearchTermChange}" aura:id="searchTerm" label="Search Products" type="search" /> ...
0
votes
2answers
33 views

how to access object values in lightning component

I want to render a table dynamically in lightning. I have a list of data of transaction (Custom object) and list of string which contains API name which data i want to render. I have created a child ...
1
vote
0answers
33 views

Send data from Lightning component to visualforce page without window.postmessage

I am using window.postmessage() to send data from lightning component to visualforce page as given in below link. https://developer.salesforce.com/blogs/developer-relations/2017/01/lightning-...
0
votes
0answers
17 views

Dependant picklist in VF Page with or without using apex controller [duplicate]

I have a custom object and it has two picklists. One of them is dependant on the other. I'm supposed to put these on a vf page. The issue I'm having is that the values of the secondary picklist are ...
1
vote
1answer
30 views

Product: You can't view this item in Lightning Experience (Salesforce1 / Mobile)

I have a custom list of Products which appear in Salesforce in both mobile and desktop. When the user clicks on the button in the list: <lightning:button label="{!r.Name}" value="{!r.Id}" onclick=...
-2
votes
1answer
22 views

Import docx.js library [closed]

How would I use a NPM library such as docx in salesforce? The folder hierarchy seems large to upload as a static resource. Please advise
0
votes
2answers
33 views

CPQ Javascript Quote Calculator Plugin Custom Script not updating

I set up a simple CPQ Javascript Quote Calculator Plugin Custom Script last week and it was working fine. Today, I wanted to update the script, but my changes don't seem to take effect. My (...
0
votes
1answer
18 views

Make tab Enable/ Disabled

In the Vf page where I created a tab. I want to make enable or disable if the checkbox is true.but my code is not working here is my code: <li class="slds-tabs_scoped__item tabs_scoped-li-2" ...
0
votes
1answer
27 views

How to close window automatically once the excel file got downloaded?

I have command button while clicking the button it will redirect to VF page where it will renderas data as excel also it will open a site.Once the excel download is completed,the window needs to be ...
0
votes
0answers
29 views

Vue datatable horizontal scroll event unfix table headers [closed]

I have a requirement to fix vue datatable table headers on vertical scroll and unfix the same while horizontal scroll in a Visualforce Page Currently, using floattable plugin, I am able to fix ...
0
votes
0answers
25 views

Trying to extract data from an object [closed]

Maybe a silly question, I am trying to extract the values of an object, for some reason I get errors. In the below picture I am trying to get the value of sumchans__totalUnits__c. The value below is ...
0
votes
0answers
37 views

Javascript issue due to spring 19 release

Facing one javascript error (reportFailedAction) after spring 19 on Salesforce community. This error stops navigation between different pages within the community and sometimes occurs on button click. ...
-2
votes
0answers
37 views

Javascript Blur() not working in VF Page

I want to blur an element on Window scroll Up event.. I am doing so using following Javascript window.onscroll = function() { document.getElementById('HtmlIdGenerated').blur(); document....
1
vote
1answer
32 views

Optimize code by reducing many If-else Conditions?

If-else code which I have written. I want to optimize it. (Using maybe Collection). Can someone show me how to do it? if(form.first_name.value == '' && form.last_name.value == '' &&...
1
vote
2answers
36 views

Required field validation error message in VF Page using Javascript? (No Alert box or Popup's)

I want simple message 'Complete this field' (as shown in image below) to displayed under input boxes which are empty while submitting the form in VisualForce page. Can someone tell me how to ...
0
votes
1answer
22 views

Is there a way to add particular <div> tags into a pdf on a button click in a vf page using javascript or the apex controller?

I know we can use the renderAs property to get whole vf pages as a pdf but I don't want that. I want particular tags in my pdf. I need a 'view/print pdf' button which opens the pdf in a new tab. I ...
1
vote
2answers
13 views

On click JS function syntax Map marker

I am trying to call a JS function on a button placed in the info window of map marker and pass the SFDC id to it, But the JS is giving me a syntax error. Here's my piece of code- for(var i=0, j=...
0
votes
0answers
13 views

Change landing app in lightning

Use Case: Our org have users coming from 2 sources using SSO. There are some common users between these sources. If user is coming from Source A, lets say landing app after SSO should be "Sales" and ...
0
votes
1answer
33 views

Refresh Component When Attribute Changes

I have a primary component that has an attribute used to render different areas of the page. I click a button that updates the variable and renders the correct section of the page. However, when I ...
0
votes
0answers
19 views

Marketing Cloud SmartCapture javascript validation

I am trying to add field validation with Javascript on a SmartCapture form. The field validation is working, however I get POST 500 (Internal Server Error). For some reason, the post method breaks ...
-1
votes
1answer
31 views

Validate a form with Apex and server side controller

what function can I use when I need to validate a form with Apex on the server side controller? I can't find functions on the internet. This is my code: View: <form class="slds-form--stacked"&...
0
votes
0answers
8 views

How to Add Toggle button and Clone| Add favourite| Delete Action Icons for a every record in records list?

I have a VF page. that page will be showing custom object quote line item records. I need show "Clone| Add favourite| Delete Action Icons" for each record which are displayed in records list view in ...
0
votes
1answer
40 views

Set the value of a radio button with the controller in javascript

I would like to do something simple but I think it is not as simple as I though. I have a form with a radio button field (salutation field in the account) and I would like to auto fill the value when ...
0
votes
1answer
29 views

Custom javascript button error message

I have a custom button and when the button is pressed the following javascript is executed: window.parent.open( "{!URLFOR( $Action.Custom_Object__c.New, null, [ ...
1
vote
1answer
45 views

Lightning Component Error For Case Close Button

Trying to create a Lightning button to close a case and I am getting this error Uncaught Unable to find action 'getCaseStatusPickList' on the controller of c:Button Callback failed: apex://...
0
votes
1answer
35 views

Re-rendering map component on the Onchange event lightning: select

I have a lightning select on my component with two values - Leads and Accounts. When the option leads is selected ,I need to display all the Leads on map and if Accounts is selected then need to ...
1
vote
1answer
23 views

How to click a button from javascript in a lightning component

I am attempting to fire the standard submit event from recordEditForm by clicking a hidden button from javascript but the below code is not working for me any thoughts? I already attempted to use the ...
0
votes
0answers
25 views

Redirect to detail page after saving record using force:navigateToSobject [duplicate]

I am getting error as "This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'setParams' of undefined] Callback failed: apex://...
0
votes
1answer
20 views

Page Refreshing and Resetting Visualforce Parameters

Through a series of events, I have a visualforce component that When a apex:outputLink is clicked calls a component controller method Calls some javascript in the component The javascript calls an ...
0
votes
1answer
24 views

Marketing Cloud Automation Studio Scripty Activity getting time out

We have script activity which is posting (HTTP post) messages to another system. However, Script activity is getting time out after 30 mins as per default timeout setting. Is it possible to override ...
3
votes
1answer
54 views

How to clear the filename and value of apex:inputFile

I have and apex:inputFile tag where a user can input a filename to upload on a visualforce page. I have a javascript function which checks and alerts if a filesize is too large. After the Alert the ...
1
vote
0answers
24 views

Adjsting the height of component dynamically

I have two child component A and B inside a parent component stacked one after other.Component A is supposed to be static and does not contains scroll bar.How ever its height changes depends on ...
2
votes
1answer
74 views

Lightning Web Components Easy Spaces sample application LWC component code

The screenshot below shows a comparison of the \es-base-code\main\default\ source code structures for the Salesforce sample application Easy Spaces - Lightning version v. Lightning Web Components ...
2
votes
1answer
41 views

How do I force a method to wait until a prior method has finished within a lightning controller?

In my controller I have an Init function that looks like this init: function (cmp, event, helper) { cmp.set('v.mycolumns', [ { label: 'Document Name', fieldName: 'Name', type: 'text'}, ...
1
vote
1answer
24 views

JSENCODE incorrect argument type

I have the following issue: var accountScheduler = "{!JSENCODE(Account.Number_Of_Due_Days__c)}"; Upon initializing the accountScheduler variable I receive the following error: Error: Incorrect ...
0
votes
1answer
27 views

Hide div from page layout after print button click

In my lightning component, I have a div with aura:id = "hidefromPDF". On Print button click I want to hide the div from page print. I tried the following code on button click { var hidefromPDF = ...
2
votes
1answer
33 views

How to set picklist value in URLFOR?

I'm trying to set a picklist value in URLFOR. I have a custom button and when the button is pressed the following javascript is executed: window.parent.open("{!URLFOR( $Action.Custom_Object__c.New,...
0
votes
1answer
37 views

Generated Javascript input to Ampscript variable

I have a quick question, I would like to pass values from generated input using javascript to an ampscript variable. My goal is to create a data extension MC from a Landing Page so the user can insert ...
0
votes
2answers
42 views

Getting an “Invalid Definition for Null” error when trying to associate controller with component

I'm creating a lightning component named "scroll" and a controller file associated with it. Here's the opening tag of .cmp file: <aura:component controller="scrollController" implements="force:...
0
votes
1answer
52 views

Automating GTM in each landing page

While creating a landing page in marketing cloud, I added the GTM code in the (head) section and (body) section of the html in code view (image attached). I will be creating many more landing pages in ...