Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
1answer
47 views

Script Activity error in Automation Studio

I'm trying to run a Script Activity to update specific fields of a Lead in Salesforce (Marketing Cloud connector is already configured and working properly). Once I click on 'Validate Syntax' it ...
0
votes
1answer
22 views

Lightning Design System - VF Sorting Function

We're adding some additional functions to an older tool which was originally built using the Lightning Design System on Visualforce. The stakeholder is requesting a sort function on a datatable which ...
0
votes
1answer
35 views

convert javascrip function CryptoJS.HmacSHA256() to apex

I am trying to convert the below javascript code into apex. The javascript code is below- timestamp = Math.round((new Date()).getTime() / 1000); var method = request.method; var path = request.url....
0
votes
1answer
40 views

PII Preference Center field masking

I have a preference center that is also accessible from the homepage (non-cloudpage) via an email entry form. When that form passes through and returns a valid record, it fills out the subscriber's ...
0
votes
2answers
76 views

How to insert ContentVersion with preview in files?

I can insert an image, but it's without preview. I can open the image after downloading, but a need preview. It writes in files "No preview available". How to fix that? Here is my code. js: ...
0
votes
1answer
31 views

How to calculate count of records in map based on keys in Helper

I am getting map in helper in callback action.setCallback(this, function(response){ var state = response.getState(); var wrapperRecords = response.getReturnValue(); ...
0
votes
0answers
46 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 ...
1
vote
0answers
69 views

Add addEventListener for blur to lightning:inputField

I want to invoke a method when inputfield is off from focus state(blur). I am trying as below but i am not able to get the alert statement when the cursor is out of focus from field . Can some one ...
1
vote
1answer
155 views

Blocked by CORS policy: No 'Access-Control-Allow-Origin' header on the requested resource

I am trying to use a Google Charting library inside a Lightning Aura Component. Component <aura:component implements="flexipage:availableForAllPageTypes"> <ltng:require scripts="{!$...
1
vote
1answer
32 views

How to get checkbox value and change tht button's class with <aura:if>?

I want to change the button's style (class) by clicking and changing checkbox field Selected__c. But I always get class="blueColor" even if checkbox is true. When I write <aura:if isTrue="{!v....
1
vote
0answers
49 views

Maximum call stack size exceeded when trying to set an Attribute in lightning component

Hi I have been getting a weird error when trying to set an attribute in the lightning component. This attribute has been pass to the child component from its parent. The attribute that I am trying to ...
2
votes
1answer
54 views

onUtilityClick() refresh component

I am trying to build a utility bar item that is refreshed when the user closes and reopens it. I tried implementing the onUtilityClick() function in my init method but I'm getting the error 'Error: ...
0
votes
2answers
21 views

Delete button is disabled due to time out issue

I have a page where websites are built by the users. When an user tries to delete the site from the page, the page is throwing error stating there is some issue and the delete button is disabled ...
0
votes
1answer
57 views

Radio button request parameter handling

Somewhat related to this post: How to catch selected radio button with requestParameter? I have 5 subscription options via radio button on a cloudpage. Since the attribute name is shared, I cannot ...
1
vote
0answers
59 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
2answers
54 views

how to call javascript function from action function?

found error after clicking button'Genrate invoice' Error:: Uncaught SyntaxError: Unexpected token ** how to resolve this?? visual force page:: <apex:page standardController="Payment__c" ...
2
votes
1answer
89 views

window.postMessage does not work in lightning console app. Any workaround?

We have an flexipage/app which have 5 lightning components on it. Out of these 5, 3 are lightning component and 2 are visual force pages embedded inside lightning component. I went through https://...
1
vote
0answers
27 views

onclick event not working for th tag

I'm able to successfully do onclick events in my component, except when I try it on <th>. Why doesn't it work? I'm trying to do an onclick event on the <th> to do sorting of the table data....
0
votes
0answers
22 views

Visualforce Button in Lightning

Is there any way to close a subtab in Lightning using Javascript? When the button flow is ran, a new subtab is opened. Below is my VF Code. <apex:page standardController="Case">> <...
0
votes
1answer
17 views

Update style on newly rendered li element

I want to render a list, and then select one of the list elements and apply style changes to it based on an index. At the moment it seems like the style change is being applied before the list is ...
-1
votes
1answer
34 views

I am facing the error parameter Id is missing,while conga composer from VF page button click

when i select the records in vf page ,after click on the VF Button the conga should be call along with id for generating the PDF but on button click the window is opening but showing error that "ID ...
0
votes
1answer
87 views

Dynamically change background color using controller on lightning component

I would like to implement component having a background color change feature. I tried to get some information on how to change CSS using Lightning Component controller, I couldn't get much about it. ...
-1
votes
1answer
24 views

toLowerCase method not working inside a filter method [closed]

I am trying to use toLowerCase method inside a filter method. For some reason it doesn't seem to work. Not sure what I am doing wrong here. PLz advise! mdu["aaUnits"] = allUnits.filter(x => { ...
0
votes
1answer
26 views

javascript don't get controller array in production environment

I have a VFP that read a web service to get positions, this positions send to js as array, in sandbox environment works well but when I make the implementation to production environment the arrays are ...
1
vote
0answers
35 views

How to get an Apex Class (not controller) error message to display on a VF page [duplicate]

So we have a tool that manages a specific service ticket group, the VF page has its own controller with the account being the standard controller. But the case Apex class handler (we do most of the '...
0
votes
0answers
44 views

Refused to run the JavaScript URL because it violates the following Content Security Policy

I am using ringcentral salesforce integration when i click on (click to dial) it is not working. Refused to run the JavaScript URL because it violates the following Content Security Policy ...
1
vote
1answer
24 views

invoking .click() function in lightning component

Client needs demand that we don't use the default SLDS style for the file uploads. Basically, have a specific icon we have to use for uploads which isn't the SF one. In prior releases, we were able ...
0
votes
1answer
37 views

Conditional formatting of the Style attribute on apex:outputText in a custom visualforce page

Looking to get some feedback on a problem and have 3 possible solutions which I am struggling to get working. The functionally I am trying to achieve is in an apex:outputText element I want an ...
0
votes
0answers
170 views

Uncaught Error in $A.getCallback() [Cannot read property 'config' of undefined]

search : function(component, event, helper) { if(component.get("v.dateValidationError" ) == false){ var action = component.get('c.availableInventoryList'); action.setParams({ ...
0
votes
1answer
32 views

How to refresh a standard page using remote action in vf page?

I need to trigger a controller action once user loading the standard account page. So that I have created a custom vf page with zero height and embedded it in the account page layout in order to call ...
1
vote
0answers
33 views

Alternative to lightning:overlayLibrary in LightningOut

I have a Visualforce page which loads a Lightning Aura Component using LightningOut. The Lightning component uses a <lightning:overlayLibrary component, which is not supported in LightningOut. ...
0
votes
1answer
80 views

Error in $A.getCallback() [Cannot read property 'fire' of undefined] failed: $A.get('e.force:refreshView').fire();

Background I have a Visualforce page which loads a Lightning Aura Component using LightningOut. When the Lightning component executes this line: $A.get('e.force:refreshView').fire(); I get this ...
0
votes
2answers
70 views

Show message and grey out button in lightning component

I have a component and I want to show a message and grey out the button if some fields are not filled, how to do this? Component: <aura:component controller="purchaseOrderComponentController" ...
0
votes
0answers
18 views

Is there a way to create a custom toast instead of a javascript alert on a visualforce page? [duplicate]

What I require is that when I select a value from a picklist I need a toast that has a message for the user. I have already achieved this through the js alert but that wasn't that difficult. But I don'...
0
votes
1answer
43 views

Compare fields in lightning component

I have a lightning component which the goal of it is to open a page if some fields on the record are not null, how to compare those fields to null? Here the component: <aura:component controller="...
-2
votes
1answer
45 views

How to call one method after another in wrapper class? [closed]

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. ...
-1
votes
1answer
38 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
55 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
38 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
32 views

Disclaimer Popup on Chatter Group [closed]

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
20 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
510 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
38 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
13 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
28 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
20 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
248 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
48 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
67 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=...