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.

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

Has anyone successfully implemented Javascript in CPQ Cloud

I am trying to call AJAX for few attributes through Javascript. I have few files of framework V2 in my File Manager but I am not able to find my start point. What is the process I need to follow?
0
votes
0answers
19 views

force:recordData simpleRecord returning null

Component <aura:component implements="force:lightningQuickActionWithoutHeader,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > <aura:...
0
votes
1answer
24 views

Locker Service Blocking Access to Third-Party Object

I'm running into a scenario where I can't tell if Locker is preventing accessing an API call from a third-party script that's been whitelisted. I'm using Qualtrics survey tool to poll users on our ...
0
votes
1answer
529 views

getParam Not Working on Simple Application Event

I have a button which when pressed causes an application event to fire. Before it does this it sets a string value using setParam. The event is fired and handled successfully. However, when I try to ...
1
vote
1answer
830 views

Javascript error on Button click

I am using one custom list button on one of the related list. But sometime when I click on this button I am getting the below error message: A problem with the OnClick javascript for this button or ...
0
votes
1answer
338 views

Uncaught ReferenceError onclick of checkbox

I'm calling javascript method from apex:inputcheckbox but facing an error: Uncaught ReferenceError: disableChebox is not defined Please help me, as I'm not able to understand why I receive this ...
0
votes
0answers
8 views

Setting Event Action and Event Label to send to Google Analytics

I have Google Analytics running on my Community. I am using Javascript to send event information to GA when a user clicks on a button. Additionally, SF automatically sends a "Searched Community" ...
0
votes
0answers
17 views

Snippet causing page to not save

I have a snippet made to execute on Before save/update which causes the page to be stuck loading. Its just a console.log("js snippet"); return; I get the expected output, but the page gets stuck ...
0
votes
2answers
531 views

SSJS Rows.Retrieve not returning any rows

I'm having an issue where I'm unable to retrieve any rows from a DE that I know is populated inside an automation. Here is my code: <script runat="server"> Platform.Load("core","1"); var ...
1
vote
1answer
42 views

Using AMP script and javascript

I have a js function that returns a value I extracted from the HTML DOM. Now I want to send the data to AMPscript and store in a variable. Can it be done in that way? Or is there a better way? Also, ...
0
votes
2answers
353 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
341 views

How to modify inner html value in lightning component?

I want to set inner html value dynamically from custom label . <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"> Lightning controller : var hideElement = ...
2
votes
2answers
58 views

Issue with for:each Index in LWC

In LWC am trying to iterate over a list and show the details from the list, this is working correctly , but as a header want to show the record number in a displayed order, below is desired outcome ...
1
vote
3answers
56 views

Interacting with the (browser) Clipboard from LWC

I have an LWC component that represents an SObject in a grid-based presentation. The grid is generated by a parent LWC component. The LWC component is to provide a "Copy" action that copies the ...
1
vote
1answer
34 views

4 Level Picklist Dependency

I'm trying to set up 4 picklist that are dependent on each other. The idea is this: There are 4 different picklist. Pick1, Pick2, Pick3, Pick4 Pick2 is dependent on Pick1. Pick3 isn't necessarily ...
4
votes
2answers
72 views

LWC: Difference between “window” and “this”

I am trying to understand what exactly is the difference between window and this in the context of a LWC component. According to this link the Locker intercepts calls to the Window and uses Secured ...
0
votes
1answer
14 views

How to get value of inputSelectOption in controller lightning

I have a lightning component which fetches all the recordtypes of an object. The user kan select the desired recordtype from a picklist. How do I get the selected label or value in my controller. I ...
0
votes
2answers
37 views

Passing parameter in getRowActions

JS Noob here. I am currently following lwc datatable documentation to create a datatable with actions. The constructor has an argument as 'data' which I want to pass in getRowActions method. The '...
1
vote
1answer
26 views

SpeechRecognition in LWC

Did anyone try SpeechRecognition in LWC? I am trying to implement it in LWC, however, I see the error 'SpeechRecognition is not a constructor', but it supports the SpeechRecognition. window....
1
vote
0answers
10 views

Form Assembly, bringing a Time field value into a dropdown

I am managing a page which allows the update and editing of Campaign objects, used for group tours of a campus. I am attempting to feed a value from my Campaign objects's Start_Time__c field (Time ...
0
votes
1answer
23 views

querySelector on inner template element

I'm trying to reach a lightning icon in my component and it is not working. It is wrapped with a <template if:true={condition}> <template> <template if:true={condition0}> <...
2
votes
1answer
58 views

Keypress ESC in LWC

I'm looking to add a listener for key "ESC" pressed during interaction with a modal to close it. Because of DOM containment, it seems that I should NOT be using window or document to add a listener ...
0
votes
1answer
23 views

Javscript button to Lightning Experience

I am trying to convert the Salesforce Classic Javascript button to Lightning Experience. The button has a custom URL. I don't know how to replace the custom URL in lightning. The button uses the ...
1
vote
1answer
117 views

Document.fullScreen API implementation in Lightning Web Components(LWC)

I was trying to achieve full screen on an element in Lightning Web Components but was unable to use Document.fullscreen API. I tried var elem = this.template.querySelector('svg'); if (elem....
1
vote
1answer
80 views

Insert HTML In Javascript Variable

I'm trying to set a javascript variable to a html code, but I've noticed something weird. when I write an html tag in a quote (such as body end tag), it formats it as HTML. for example, when I execute ...
0
votes
3answers
977 views

DocuSign Custom Button

I am fighting with a javascript custom button, I would like to add the behavior to auto populate automatically over the DocuSign envelope the documents. I'm not able to find a way to make this work ...
1
vote
1answer
356 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
votes
1answer
33 views

Issue with passing class data from apex to javascript in LWC [closed]

I am trying to return multiple values from the apex to javascript using wire decorator. Because of functions in apex cannot return multiple values at the same time, I am returning custom class ...
2
votes
2answers
704 views

Print only a single tab on a tabbed VF page

I have created four apex tabs in a vf page. In that page,I'm using print functionality for the particular div section.Its works fine when i click the print button for the first time.But when i click ...
0
votes
2answers
453 views

Merging multiple attachments of a record into a single pdf

Is it possible to merge multiple attachments of a record into a single pdf using javascript or Jquery. Has anyone tried this kind of scnario. If yes, please guide me towards the solution. Regards
-2
votes
0answers
39 views

Traffic Light button in Lightning datatable [closed]

I have a lightning:datatable wich shows/edits records of a custom object. In one of the columns I want a button that represents a traffic light, so it's default color is green, click on it and it ...
14
votes
4answers
1k views

Lightning Framework vs Standard Client Side Frameworks (i.e. React) // Which to chose when, and why?

Disclaimer Keep it objective! This one can get a little opinionated, please try to keep your answer specific to the facts a developer should be considering when choosing between two viable options ...
-2
votes
0answers
21 views

Converting Javascript functionality to Visualforce Page [closed]

I am trying to move an OnClickJavascript button to VF so that it can work in Salesforce Lightning, however not able to rectify the issue in the below code. Need Help JavaScript Code: {!REQUIRESCRIPT(...
0
votes
1answer
36 views

Position fixed problem lightning

I have a custom lightning component on a record detail page. The component has a message which i want the user to be alerted. Everything works great but now i want the banner to scroll also if a user ...
8
votes
2answers
4k views

How to make force:navigateToSObject to open record in new tab

Is there any way to make force:navigateToSObject event to open sObject in new tab?
0
votes
1answer
382 views

Jquery validator with javascript remoting

I have an input field out of several on a form, whose value needs to be validated against database values. I am using jquery validator to perform all other validations and trying to achieve database ...
0
votes
3answers
566 views

send email with a button

I need to send an email with a specific email template after pressing a button on opportunity layout. I created and put the button in the opportunity layout (below the image shows the button) the JS ...
0
votes
1answer
17 views

javascript error on command button

{!REQUIRESCRIPT('/soap/ajax/39.0/connection.js')} var rec = '{!JSENCODE(TEXT(Apttus__APTS_Agreement__c.Reason_for_cancelation__c))}'; if(rec != "--None--" ) { HYPERLINK("/apex/...
0
votes
2answers
395 views

Copy value of checked inputField to another inputField

I want to copy a value of an inputField which is checked and paste it to another inputField. I can do it with Javascript like this : function copy(test,test2) { document.getElementById(test2)....
4
votes
0answers
35 views

Jest Unit test an event that dispatches inside XMLHTTPRequest (XHR)

How do I test an event that does an XHR request and dispatches an event? I managed to install the dependencies to mock the xhr using https://github.com/jameslnewell/xhr-mock/tree/master/packages/xhr-...
0
votes
1answer
28 views

How to display Several URL"s in toast message

I have a requirment where i need to show some alert messages to the user. The alert message should be non blocking and if the user scrolls the page down, the alert should also move so that the user ...
1
vote
1answer
21 views

Deselect checkbox on click of a button

I have the following code in my lightning component <lightning:input type="checkbox" label="Life" aura:id="checkboxField" value="{!v.isLifeChecked}" ...
0
votes
1answer
20 views

Need to pin a lightning component so it is always visible on the page

Let's say i have a custom lightning component which have some kind of message embedded. When i add my custom lightning component to a record page and the user is viewing the record page where the ...
0
votes
1answer
21 views

How to pass event.preventDefault(); from child to parent

I have a wizard with a child object. The child object has an event.preventDefault(); (Step 2 wizard). How do I pass this to the wizard (parent) to prevent going to the next page (step 3) of the wizard....
0
votes
1answer
15 views

How to pass parameter to recordEditForm on init

I have 2 child components in a wizard the first on the first page the second on the second page. I pass a recordtype Id from the first component to the second component trough an event how do I pass ...
0
votes
0answers
10 views

How i can send Html template with js custom button?

I added custom button from my case object inside, then i sent test mail its work but i want to use Html template, also i want to add my records from html templates for example "Hello Your Account Name ...
2
votes
1answer
30 views

Convert Opportunity javascript button to Lightning Component

I have an onclick javascript button and converted this button to an lightning component(full) using the Lightning Experience Configuration Converter tool. But,when I'm testing the converted button,...
0
votes
0answers
24 views

JS button in i cant get Owner Name in my array

Hello friends Firstly i create to button for SendMail and i want to get Case.Owner.Name in my array, i try i can get another fields data in my array, when i try to get Case.Owner i taking error ...
0
votes
1answer
351 views

Display/Hide an Empty Table On Click of Javascript Checkbox Using Jquery and Visualforce

I am trying to search anything about automatic rendering of an empty table row for each selected javascript checkbox using jquery and visualforce. The aim is for every selected row from CustomObj__c,...
0
votes
0answers
9 views

Call javascript function(which is there in visualforce) on click of custom button

I have a javascript function in a VF page, can I call this javascript function through custom button(created at object level). I don't want to rewrite this javascript at button level, I just want to ...