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
1answer
12 views

Error loading third party js library

Just trying to load a js library in a LWC. Cannot even get the thing to load. I just want it to load and do nothing. Static resource here: Name headerConfig Namespace Prefix Description MIME Type ...
0
votes
0answers
14 views

Which field is causing: “Unable to read SObject's field value[s]”?

I know this error is because there is a wrong data type, but I feel that I have validation on all my input fields. I have had this error 3 or 4 times over the past year with customers and am at a loss ...
0
votes
0answers
11 views

Upload files via lightning:fileUpload

I am developing a visualforce page. I need to download several pdf files from remote server to ContentVersion. I was surprised that I can't directly upload fetched file's blobs to the lightning:...
0
votes
1answer
22 views

Issue with querySelector lwc

I'm doing a simple operation wherein I'll disable a button on component based on certain condition. I use queryselector to get the correct button and then disable. Button HTML: <lightning-button ...
0
votes
0answers
26 views

Java Script button in lightening configuration conversion error

while converting Java Script button i am getting below error message. Something went wrong with the deployment. Component: LCC_Confirm_Shipment_Scheduled_Event_cController. Problem: ESLINT_ERROR: {c:...
0
votes
0answers
22 views

Unexpected behaviour when calling Apex controller method from Lightning Controller

I'm implementing Braintree drop-in UI in a Lightning Community. For this purpose I embedded the drop-in UI in a VF page and added that to lightning component inside an iframe. Communication done using ...
0
votes
0answers
8 views

Help - Convert Opportunity javascript button to Lightning Component

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

Assertion Failed error when namespace is changed in aura component

Similar to this Post, when i change the namespace in aura component from ui:inputText to lightning:input, I'm getting the following error: Assertion Failed!: Attribute not defined in the component : ...
0
votes
0answers
13 views

overriding mouse event listeners in Service Console tabs

I have a component with a mouse event listener. the event listener is added on init. When I have multiple tabs open with my component, only the first tab is registered to the mouse events (as it was ...
0
votes
0answers
20 views

Dynamically add More button if text-overflown: ellipsis is applied [closed]

I have a table with multiple text-fields each <td> has max-width; text-overflow:ellipsis; overflow: hidden has css properties set <table> <aura:iteration items="{!v.list}" ...
0
votes
1answer
25 views

error while changing the ui namespace to lightning namespace

I have a requirement to change the namespaces from ui: to lightning: as ui namespaces are going to get depricated in May'21. While doing so, I'm getting the error from the following tag <aura:...
0
votes
0answers
32 views

Web-to-lead API CORS issue

I am using the We-to-lead form to populate Sales Force, but I would like the form to submit via AJAX rather than default form submission. The default form submission works fine and populates Sales ...
1
vote
1answer
23 views

How to update global variable in emp-api

I need to update a global variable when a push topic is created. import { LightningElement, track,api } from 'lwc'; import { subscribe, unsubscribe, onError, setDebugFlag, isEmpEnabled } from '...
3
votes
1answer
51 views

dragable div element in LWC

below HTML and JS I have written by going through some documentation on drag event. Not able to save anything on LWC playground so posted all code below which renders as shown in the below image. ...
0
votes
1answer
17 views

lightning-input type date time picks incorrect time value

I'm using lightning-input type="datetime" to take datetime input from a user inside a lightning web component. I initially bind the value returned from back-end to the input. It displays the ...
0
votes
0answers
19 views

How to show the column values from a list in form of header for another list/grid in LWC [closed]

For an example I have two columns name and Id in a list, Name is having 4 rows, now how can I print/show these 4 values as header of a grid/list. Query: Select Id,Name from Contact LIMIT 4 eg. I want ...
0
votes
0answers
55 views

How to make the search bar appear like a fluid from the search button [closed]

<template> <div id="waiting" if:false={ready}>Loading…</div> <div id="display" if:true={ready}> <div>Name: {name}</div> &...
0
votes
2answers
28 views

Trigger to Count the Number of Campaigns a Contact is Associated With

I have a working trigger on CampaignMember that will update an "Events Attended" field on Contact whenever they are added to a campaign. I want to go one step further and limit it to only ...
0
votes
0answers
35 views

string length and endswith condition not working in Javascript

I have a requirement to check the length of the field and its ending letter so that i can update a field based on that. below is the lightning helper js controller code: var policyName = helper....
0
votes
1answer
19 views

Working with rereshApex async call in LWC

I am trying to work with refreshApex call in LWC to get the refreshed values for the wired data. @track records; @wire(getRecords) wiredRecords({error, data}) { if (data) { this.records = ...
0
votes
2answers
42 views

Hide the spinner on LWC after file download using XMLHttpRequest

I used the below JS code to download a file. It makes the spinner visible using loaded=false but the line loaded=true doesn't make the spinner hide. handleResourceDownload(event) { this....
0
votes
0answers
15 views

waiting for a postMessage to arrive to aura from vf page before save

I have a Component that wraps a VF page as an iframe. The VF page has one apex:inputtextarea which uses the CKEDITOR library to expand the rich-text. I'm trying to implement the Communicating between ...
0
votes
1answer
29 views

Calling apex rest API endpoints after auth in an external JS app

I'm a little worried that what I want to do is not supported at all and I'm hoping someone can quickly give me an indication if I'm on the wrong track. My goal: Create a client-side only JS app on an ...
0
votes
0answers
26 views

Tracking multiple input field values in for each loop and saving to the DB - LWC

I'm pretty new to LWC as well as Javascript. I have a loop in my template where I want to retrieve the new values that the user will input in each input box and build up a new JSON object so that I ...
0
votes
1answer
28 views

Lightning JS not firing the error message

I have a requirement to merge custom leads. When two leads are selected to merge and if their Integrated_Lead__c (datatype - checkbox) is true, then an error message should be displayed on screen. ...
3
votes
1answer
40 views

How to conditionally disable the LWC Standard Datatable buttons

I have two buttons called Add and Remove in my datatable columns, i have a checkbox field called isActive on my Account object. If isActive=true, on load of my component Add button should disable ...
1
vote
1answer
24 views

Grouped Bar Chart using Chart JS unable to make it dynamic with List Of Objects in Lightning component

I have built a code snippet to draw a dynamic Grouped bar chart using Chart.JS where status and priority are the group by fields. Now I want to make these two fields also dynamic based on the object i....
0
votes
1answer
37 views

Dynamic dom element in LWC JavaScript

I am trying to build a table dynamically from the javascript which runs is already in Aura component. tableBody = tableBody + '<tr>'; tableBody = tableBody + '<td><a href="...
0
votes
0answers
35 views

How to put a over in the LWC that is displayed on the overing of the mouse on the link

I need to put an event in my lightning Web component "onmouseover" whenever user bring the mouse over thetest i need to display a badge full of message, currently it is not coming as ...
0
votes
0answers
18 views

Lightning map Marker CSS

Good Morning. A few days ago, the Lightning Map Marker CSS stopped working. As shown in the image below, the return is in "String" format instead of "Tag". Was there an update to ...
-1
votes
1answer
46 views

HTML markup in single line in grid [closed]

I need to put the value in single line in the grid in the extreme right of the LWC component. can anyone help me out for this. below is the code HTML Markup <template> <main class='...
1
vote
1answer
22 views

How to pass map values on client side from component to controller

I currently have a child component to which I pass some map values from a parent component to an attribute in the child component on the client side. I used an example which gets map values from ...
0
votes
1answer
20 views

Id variable undefined in javascript aura - not getting set in time before rest of code runs

I have an Id variable undefined in javascript aura - not getting set in time before rest of code runs. I am needing the variable v.workOrderId to be populated before other helper code runs. I'm ...
0
votes
1answer
25 views

Convert lightning JavaScript wrapper into JSON

I need to convert javascript code into JSON. I am passing list from apex class and i want to convert that wrapper into JSON in below format. { "recordtype":"salesorder", ...
0
votes
0answers
28 views

How to capture a screenshot of a lightning page on button click when Lightning Locker is enabled

Option 1 : Using Screen Capture API (Reference : https://salesforcecodex.com/2019/09/capture-screen-using-lightning-component/) Here I used navigator.mediaDevices.getDisplayMedia(displayMediaOptions) ...
0
votes
0answers
18 views

How to implement Google Analytics event tracking in lightning community with LWC?

I'm thinking to implement Google Analytics event tracking in lightning community with LWC. But I found this information at Salesforce's help document. Is there any way to implement it?
1
vote
0answers
51 views

Post custom HANDLER URL reCAPTCHA

I am trying to implement reCAPTCHA validation via Marketing Cloud - cloud page. I have used this guide to do that: https://ampscript.xyz/how-tos/how-to-implement-google-recaptcha-on-marketing-cloud-...
0
votes
0answers
15 views

Is there any way to Obfuscated JS code of Custom Components in Force.com Sites?

I noticed that the Aura Custom Lightning Component's JS code is easily readable on the browser when the components are used in a custom public site. Is there any way to Obfuscate that JS code? I ...
0
votes
1answer
37 views

Im getting Nan error during subtraction of two times not two dates. can you please help me how to resolve it

var startDate = component.get("v.time"); var endDate = component.get("v.time1"); var days = (endDate-startDate)/8.64; alert(days); I'm getting error like ...
0
votes
1answer
25 views

How I can pass all user inputted quantity values for each row from apex:pageblocktable to apex controller in visualforce?

I am able to pass single value from vf to controller. But here are list of quantity values. Here is my visualforce code - <apex:page standardController="Billing__c" extensions="...
-2
votes
0answers
26 views

here i want to print innner map key and value on component in aura itrerater

here is my map ;- Map<String,Map<String,Integer>> i want to print inner map values in iteration here is my js controller:- console.log(component.get("v.selectDateRange")); ...
0
votes
1answer
40 views

Can we use Node.js in Marketing Cloudpages?

We are planning to make Web scrapping tool in cloud pages using node.js . I want to know can we use node.js libraries and function in cloudpages ? We have a Url of a web page as input .Request {Url} ...
0
votes
0answers
38 views

This page has an error

I've created a lightning-datatable and I'm trying to filter records in the lightning-datatable using a custom search box. However, it displays a pop-up with error which says SORRY TO INTERRUPT -> ...
1
vote
2answers
62 views

How to pass the value from parent component to child component on load in LWC?

I have this scenario. I am having a getRecord wire method in parent component which is assigning a field value to the variable. That value is passed to the child component. I have a connectedCallback()...
1
vote
2answers
50 views

How to format a date in a javascript?possible [closed]

How can I format a date object to print as today instead of showing a numeric date in a javascript? I'd like to display it like this: today At 5:00 PM. js var today = new Date(); var date = new Date(...
1
vote
1answer
43 views

SSJS redirecting to wrong page

I have a processing cloud page and the page redirects correctly to success page but when I add in extra bit of code for error page redirect, records evaluating success still goes to the error page. Am ...
0
votes
0answers
27 views

Having Trouble with with conditions

I am building a lightning web component that basically puts certain attributes on fields depending if it passes conditions. I was able to make it work with just passing all the conditions, but now I ...
0
votes
1answer
13 views

Call JS method from IF loop in Visualforce

I am trying to call the JS method "returnToProposal" from an IF loop. Not sure what I am doing wrong here. I am getting the error Error: Unknown function returnToProposal. Check spelling ...
1
vote
2answers
80 views

Removing the value from array after unchecking the checkbox in LWC

I have a html table in which there is a lightning-input type checkbox for each row of the table in the child component. On checking the checkbox the row id is passed to the parent component and pushed ...
0
votes
1answer
18 views

Javascript button with multiple validations [closed]

In the javascript button below (Salesforce classic) I would like to allow users to proceed only if a selected status is active. Also for a specific user profile, I would like to not allow to proceed ...

1
2 3 4 5
87