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

In LWC JSON.parse(JSON.stringify(array)) not working as expected

I have an LWC that calls the backend, which makes a callout and returns the response wrapped inside an inner wrapper class with @AuraEnabled member variables and this wrapped class's @AuraEnabled ...
user avatar
  • 456
0 votes
1 answer
44 views

how to use SSJS to extract all distinct values (may require looping) and push it to sql query in marketing cloud?

I am new to SSJS and have not used it yet. I have a use case where I need to extract JobID and EmailName from SendLog Data Extension. I use JobID and EmailName in SQL query but right now I need to run ...
user avatar
  • 99
0 votes
0 answers
47 views

NoErrorObjectAvailable Script error Salesforce LWC when updating LWC data table with changed picklist value

I have implemented Custom type (custom component and custom data table) to show picklist values in LWC datatable. I have an event fired from this custom component and handling this event in my ...
user avatar
0 votes
1 answer
44 views

How to show results of map<> written in Apex from LWC JS and HTML

This is my Apex Class: public without sharing class VF_SurveyResponsePOC { public static Set<Id> setOfResponseId = new Set<Id>(); @AuraEnabled(Cacheable= true) public static ...
user avatar
  • 9
5 votes
0 answers
40 views

How to use loadScript with Light DOM in LWC - getting error "Invariant violation: Expected template to be an object"

I'm trying out the Light DOM beta as I want to see how it will work with certain 3rd party libraries, but I cannot load a 3rd party javascript resource. I have the following component on a Salesforce ...
user avatar
0 votes
1 answer
16 views

Do not render data when lightning-accordion is collapsed

I have a lightning accordion and lightning accordion section with some data when they are expanded. I would like to show/render this data only when the accordion is expanded/open and when it is ...
user avatar
-1 votes
1 answer
36 views

Access lightning-record-edit-form fields from parent LWC

I have a child component with a lightning-record-edit-form that should work as a standalone component and as a child component as part of another flow. The form takes inputs from users and then, with ...
user avatar
0 votes
1 answer
16 views

error message only appears at the 2nd click

I need to show a toast with an error message on a LWC form if one of the fields has an invalid value. the validations are done and the toast appears when it's supposed to, but the message itself only ...
user avatar
  • 1
0 votes
1 answer
22 views

lightning-combobox throwing error on selection

I have a lightning-combobox which gives the options to select a field from an fetched apex collection. The component loads without any issue on the page as soon as I select an option I get a page ...
user avatar
  • 2,092
0 votes
1 answer
26 views

LWC [object Object] returns undefined when trying to access property values

I have data returned from apex as a string: [{"Rank":1,"Points":61,"Name":"Susan Johanson","Id":"0038d00000ANPt7AAH"},{"Rank":2,&...
user avatar
0 votes
0 answers
19 views

How to create Custom Detail Link on a Record Page that opens my JS modal

I am needing to create a custom detail link on a custom object detail record page that will open my custom JS modal (Which in turn generates a dynamically filled text file from the Record ID). How can ...
user avatar
  • 1
0 votes
0 answers
16 views

Integration of Salesforce with Link2Feed. How to convert a Javascript pre-request script into Apex?

I'm trying an integration of Salesforce with Link2Feed system. I have a pre-request script in postman but it's written in Javascript and I am having trouble converting that code into Apex. I'm not ...
user avatar
  • 1
0 votes
1 answer
23 views

Aura Component: (lightning:input) Fire 'onclick' before the 'onblur' event

I have the following code in the cmp file: <lightning:input onchange="{!c.handleChange}" onclick="{!c.handleClick}" onblur ={!c.handleBlur}" /> Issue: I want the code ...
user avatar
  • 322
0 votes
0 answers
25 views

From Apex server data is not coming to Aura components

apex wrapper : public with sharing class DemoWrapper { public class Timesheet{ @AuraEnabled public String employeeId {get;set;} @AuraEnabled public String employeeName {get;set;} ...
user avatar
-1 votes
0 answers
22 views

I have an array of objects, and I need that when the SA7_Iniciativa__c field is repeated it generates a new output [closed]

const data = [{ Id: "a3Z6s0000009WOMEA2",Name: "L-0093",RecordTypeId: "0126s0000000KiiAAE",SA7_Compra_de_Licenca__c: "a3X6s00000013BsEAI",SA7_Iniciativa__c: &...
user avatar
  • 1
1 vote
1 answer
72 views

How to use a new Set() in LWC?

I am trying to declare a Set as a class property on my JS file and add elements to it in a function. The issue is that the elements are never added to the set at all. import { LightningElement,api } ...
user avatar
0 votes
0 answers
56 views

Third Party Library DOMPurify on lwc - Failed to execute 'createNodeIterator' on 'Document'

I'm trying to load DOMPurify in lwc in order to sanitize some data, but I cannot find a way to make the library work. I've tried with the minified js file as static resource, with the full files, and ...
user avatar
  • 53
0 votes
2 answers
40 views

highlight a search word in LWC for each loop

I have the below code where i want to highlight a given word .But the word is not getting highlighted. Tried using tag Below is the code. FOr this below given code, i am trying to highlight word &...
user avatar
  • 1,528
1 vote
1 answer
94 views

How to use @track and @api at the same time

I have a variable newtags that contains tags added by the user. When a tag is added it's shown on the interface when it's double-clicked it should disappear from the interface, for this matter I used @...
user avatar
0 votes
1 answer
32 views

Conditionally disable button in LWC Datatable

I am trying to conditionally disable a button within a LWC Data Table. I have seen similar posts, however none have offered a solution. I am trying to enable or disable the button that displays within ...
user avatar
  • 31
0 votes
1 answer
19 views

Salesforce Onclick Javascript button not working

I haven't changed the script or suddenly the button throws an error that is not defined or shows up in debug logs. The basic function of the button is to grab 'Items used' from a case and create a new ...
user avatar
0 votes
1 answer
24 views

Error passing argument to Apex method

I have an event that is triggered on a button click. This event calls an Apex class, passing an argument with it. Without the argument, the code runs fine, however when I pass in the parameter I am ...
user avatar
  • 31
2 votes
0 answers
21 views

How to prevent unmounting of component when using errorCallback lifecycle method in LWC

I am having an root LWC component and nested inner child LWC components structured like below for example. <c-application> <c-header></c-header> <c-form-container> <...
user avatar
  • 133
0 votes
2 answers
63 views

Bind disable attribute dynamically for each row for disabling button row-wise in LWC

[![enter image description here][1]][1]I have a situation in LWC. In a table there are multiple records coming dynamically with selection of available dropdowns. Each row has Approve and Reject button ...
user avatar
0 votes
1 answer
23 views

Blanking a Field that is not writeable and passing to a lightning data table

I am using Apex to call an SOQL query that returns records and a few of their associated fields, some of which are formula fields which (to my understanding) are not writeable. I am then passing this ...
user avatar
  • 31
0 votes
0 answers
23 views

Trying to render Google reCAPTCHA on Visualforce page, getting an error with script src

I'm trying to render a Google reCAPTCHA on a Visualforce page. When I link to the script src, I get the below error: The reference to entity "onload" must end with the ';' delimiter. The ...
user avatar
0 votes
1 answer
23 views

How do you click on checkbox group in jest?

I am trying to JEST test a checkbox group that has 1 option and when I do .click() it says can't click null property. Is there a different way I should be hitting it with JEST? For clarification, the ...
user avatar
0 votes
0 answers
25 views

Salesforce - setCustomValidity function for disabled fields or Standard lookup fields in LWC

Need help with this scenario in LWC, i am trying to add custom error message onchange of lookup field but we are using standard lookup using Lighnting-input-field. I am also populating another ...
user avatar
  • 1
1 vote
1 answer
23 views

Salesforce Aura lightning:checkboxGroup

I have an existing Aura component that I need to add some help text to. I have a lightning:checkboxGroup that I need to add some help text to one of the options. The code is below. What I need to do ...
user avatar
  • 327
0 votes
0 answers
41 views

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'setAttribute')

Getting below error in the console tab in on change event. I have a checkbox on click of show/hide the program based on the location checkbox. Below is the code, Can you help me with, what am missing ...
user avatar
0 votes
0 answers
28 views

Error on Inserting a ContentVersion with the REST API from Javascript: "Non-binary part must be JSON or XML"

I am trying to use the Salesforce REST API to insert an JPG as a ContentVersion in Salesforce. I'm using an Ionic Capacitor mobile app with the capacitor-community/http plugin. If I'm reading the ...
user avatar
  • 617
1 vote
1 answer
39 views

Lightning web component causing refresh loop

I'm building a simple LWC with an iframe to an external messaging app. When I deploy my code as is, it causes Salesforce to refresh over and over. Not sure where I'm going wrong here. I've isolated my ...
user avatar
  • 25
0 votes
0 answers
34 views

Open a new page without Reloading the page in Experience Cloud

I want to open a new community page dynamically from the LWC component but I don't want to reload the entire page. Without reloading the page I want to show the new page in the same window. Below are ...
user avatar
0 votes
1 answer
29 views

Cannot change or access class member variables from callback function

In the below code, the function dragstarted() is D3 JS function that gets called everytime a graph node is clicked (which gets called fine). However, it is not possible to change 'clicked' or call '...
user avatar
0 votes
1 answer
49 views

How to handle a Javascript event inside .then method of a Promise ? LWC

Hello everyone and thanks for reading: I´m having a problem in a Javascript file from a LWC I´ve built. handleSaveUniqueRecord (event) { //clone event obj using spread //event cant be used ...
user avatar
0 votes
0 answers
20 views

Hide action (custom button) after use it

Hi everybody I have a detail page of X custom object that has a custom button (Action that display a Flow that has a LWC form). This button creates a record of Y custom object. I want that after the ...
user avatar
1 vote
1 answer
31 views

Do something every time an @api property value changes in child component [duplicate]

I am passing a property from a parent to a child component. I am trying to perform a task every time the value passed from a component's parent to itself changes. export default class displayData ...
user avatar
0 votes
1 answer
35 views

How to refresh the Parent component after a button on child component is pressed?

Problem: I need to have the parent component to make another Apex call, apiCallout(), after the save button is clicked on the child component. That way the UI is displaying current data, however the ...
user avatar
1 vote
0 answers
22 views

Wire Service Jest Test - Config Object Empty so filterFn not working properly

So, I followed: https://github.com/salesforce/wire-service-jest-util Testing LWC with multiple @wire getRecord calls with Jest to help get my test configuration setup for multiple @wire getRecord ...
user avatar
  • 11
0 votes
0 answers
37 views

How to save picklist value in custom lightning datatable?

I have just started working with Lightning Web Components, and I am attempting to add picklist functionality to my datatable. My standard cell edits/saves are working as intended, but I am unable to ...
user avatar
  • 1
-1 votes
0 answers
18 views

Lighting web component and flow related

One flow is calling out one lwc in which we were taking radio button input and based on that input new record was getting created on another object with the help of flow.now requirement is multiple ...
user avatar
1 vote
0 answers
28 views

Duplicate API Calls on HTTPPost

We have added an API call to one of our emails, when activated in journey builder we are seeing the same contact hit the same API twice, sometimes three times ~85% of the time. Here is the JS we are ...
user avatar
0 votes
1 answer
87 views

how to call two functions in one onclick in lwc?

I am very new to LWC and Javascript. I have an LWC component with a ightning-input tag with "type=search" and one button with onclick event. When I searched for a keyword, I was supposed to ...
user avatar
1 vote
0 answers
21 views

LWC spinner removes filter values

I have this page that displays a list of clients which can be filtered based on 4 fields. Because data retrieval took quite a while, so I have decided to add a spinner. However it seems that now the ...
user avatar
1 vote
0 answers
31 views

Add row selection values to Sets for comparison

I have a HTML Table in an Aura component with checkboxes on each row. This table displays record data from a custom object. I need a means of checking that certain fields from the selected records ...
user avatar
0 votes
0 answers
25 views

How to do a custom dependent picklist with combo box

For a LWC I have two combo box inputs lets say input A and input B. Input A has 2 values (value 1 & value 2) and input B has 2 values (value 3 and value 4). how can I restrict the behavior of ...
user avatar
  • 63
0 votes
0 answers
39 views

can not connect salesforce LWC and fullCalendar V5

I know that this question has already been asked here - stackExchange The change which has been suggested, in the fullCalendar library is I think already has been implemented in it by FullCalendar ...
user avatar
  • 1
1 vote
0 answers
65 views

Unable to load DHTMLX Spreadsheet JS into LWC

Background I am trying to use DHTMLX Spreadsheet in an LWC I've added the JS and CSS as Static Resources: DHTMLX_Spreadsheet_JS DHTMLX_Spreadsheet_CSS And I have enabled Use Lightning Web Security ...
user avatar
  • 8,272
0 votes
1 answer
49 views

lightning message service not working

I'm using Lightning message service to pass message from LWC to another LWC.Both components are custom components used in community pages. The message is not being sent to the other component. ...
user avatar
0 votes
1 answer
87 views

How to Refresh or re render DIV in lwc

I have an attachment button that works fine. Now I want to cancel button which cancels the uploaded file. For this, I need to re-render the div by clicking the cancel button. How ?.IS there is better ...
user avatar
  • 3

1
2 3 4 5
103