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
2answers
19 views

How to redirect to another page on double click of row in lightning-datatable LWC?

I want to redirect to another page on double click of row in lightning-datatable, i have tried to add double click listener to lightning-datatable but it does not work. Could you please provide any ...
0
votes
2answers
1k views

Capture JS variable with AMPscript/SSJS

I have a script with moment js library running in a landing page and the purpose of the library is to check whether today falls in Daylight Saver. If it does then the function sends a true statement ...
1
vote
1answer
34 views

The use of FlowAttributeChangeEvent in LWC

I have a lwc which is used in a flow. I have several variables from the lwc that are exposed to the flow. I need to make the flow know when these variables changes, so according to documentation I ...
0
votes
1answer
20 views

how to fix the csv file formate while downloading a field in csv format from javascript from aura component

I have an aura component to export the sobject details into csv file. I have a field EAN10 of type test on sobject which holds a number. when i download the file the value in EAN10 field is coming in ...
0
votes
0answers
17 views

Jest To call pubsub by method

i need to write the unit test of the method which is calling pubsub in the current method can anyone tell me the correct method to write the test method gentleError(event) { errorwithpubsub(...
0
votes
0answers
13 views

Problem adding class to more lines of a form using jquery clone function [closed]

I have the following doubt, I am maintaining a form using the php language, it has a method that clones all content, that is, the body of a current row table for each time the user wants to create too ...
0
votes
2answers
40 views

Use HTTP Response Body in Wired Apex

I am trying to do the following: Called an HTTP Get method from Wired Apex The callout will return an array of objects Return response.getBody the wired method. Parse the response and display in a ...
0
votes
1answer
840 views

user profile in javascript without apex

How can we get user profile in lightning javascript component without writing Apex class? Please let me know
0
votes
2answers
2k views

Opening in a new window from visualforce page opens a blank window?

I am trying to open standard page from a custom Visualforce Page through javascript using command button.But it reacts differently each time.It works properly sometimes.But in some cases it opens a ...
0
votes
1answer
683 views

Refresh browser on click button

I have a inline vf page on some X object, when I click on the "Add" button of vf page a new window in will open as a pop up displaying other page. After adding the products on click of save, i want to ...
1
vote
2answers
33 views

addEventListener listener not able to access other methods

I have added a click event handler on a particular template like this: let tableFilter = this.template.querySelector('.' + strDataTableTargetId + '_filter'); tableFilter.addEventListener('click', ...
0
votes
0answers
16 views

How to show details of Browser name and version in Lightning component

My scenario is users are login to Salesforce using different browsers like google Internet explore, Mozilla,etc ..so I have to show the detils of which browser that is.. using lighting component
0
votes
2answers
778 views

Rerendering a table row for each selected javascript checkbox

I am trying to display an empty table row (for Object2__c) each time I select a row (for Object1__c) using a javascript checkbox. There's no error but nothing happens every time I tick a checkbox ...
0
votes
0answers
19 views

Static Resource CSS not loading in a Community

I just did a sandbox refresh from our production sandbox, and I am trying to make sure the community still works. In the community in production, we added static resource css files to the markup head ...
1
vote
1answer
466 views

Partial Page refresh makes checkbox checked in visualforce Page

Here is my VF Page. function selectAllCheckboxes(obj,receivedInputID){ var inputCheckBox = document.getElementsByTagName("input"); alert(inputCheckBox); ...
0
votes
0answers
23 views

Is it possible to access the Salesforce Performance Test as a Customer Community user?

There are a number of users who only have access to our community that are experiencing a lot of issues with slow pages and I want to gauge where the performance problems are coming from (e.g. latency,...
0
votes
0answers
22 views

How to send the reference field value from SOQL result in apex to Aura component

I have a custom solution to export the product line items(custom object) into CSV file, i want to include one of the field(EAN__c) value from product(product line item is having lookup relationship to ...
0
votes
1answer
48 views

Not able to load 3rd party JS in LWC

I'm new to LWC and trying to create a simple LWC component with input field. I have loaded 3rd party zip folder in Static Resource which contain JS and CSS file. Scenario - If user types street name ...
23
votes
3answers
39k views

access controller variable in javascript

Is there any way to access controller variable set in a Method in Javascript. In the example above the value is set in constructor. But when I set it in a method it is showing as NULL in Javascript ...
1
vote
1answer
48 views

How can I communicate between two different Salesforce LWC which are in two different window

I have one LWC having one button on click of that button i want to open one separate browser window having one different LWC and then I want to pass data from second window to main browser window. I ...
0
votes
0answers
17 views

How can I communicate with component from Visualforce page which has embedded in iframe

I have created one Lightning Component, and loading that from one Visualforce page. When I click on a button in Lightning Component, I am showing another Visualforce page as a Modal (popup) by using ...
0
votes
1answer
31 views

LWC - Push New Values to Object Array in JS for use in Lightning Web Components

I just want to push new values to existing object arrays I pull using Apex but when I compile and run what I have below it simply doesn't work. This sounds like a very basic problem but I can't seem ...
0
votes
1answer
26 views

HTML table creation in lightning component

I'm trying to create a dynamic HTML table in lightning component, but have issues on capturing the clicked record from the table. Can someone please suggest what approach should I take. In the below ...
6
votes
3answers
3k views

lightning-datatable - remove header actions

Is it possible to remove the header (column) actions completely from lightning-datatable? It seems that no matter what I do I'm still stuck with Wrap Text and Clip Text actions. UPDATE Adding more ...
1
vote
0answers
19 views

Failed to execute 'add' on 'HTMLSelectElement': The provided value is not of type '(HTMLOptionElement or HTMLOptGroupElement)'

There is library written in vanilla js for datatable Vanilla-Datatables, I am trying to use that library to create datatables. HTML: <template> <div class="container-fluid"> ...
0
votes
1answer
507 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
2answers
411 views

Is there a way to call standard Quick Actions from a LWC?

I'm trying them all and it seems impossible. The thing I'd like to do is call the "Create PDF" Quick Action for the Quote object from a LWC. I tried debugging the browser and see what happens when ...
0
votes
1answer
846 views

Modal Pop-Up from Visualforce Page Included in Standard Detail Page Section

I have a Standard record detail page in which there are sections which include visualforce pages. I'm rewriting these using SLDS to look like lightning. From one VF page I'd like to open a modal which ...
0
votes
0answers
80 views

Show More / Show Less for lightning-output-field

I have a lightning web component that displays a text area for a field. I have a show more / show less link that expands the component to display more text done purely in css. Currently, this method ...
6
votes
3answers
10k views

How can one validate 'recordEditForm' fields before submitting them to the platform?

In a custom lightning component where one is using the recordEditForm tag, how can one validate fields that are filled by the user? For example, in a quick action to create a Case record, we can have ...
0
votes
0answers
26 views

How do I use Salesforce Locker console to evaluate a library? [duplicate]

There is a requirement of using an external Javascript library for excel file generation(xlsx). I was planning to use Sheetjs or exceljs to achieve the same, but wanted to know how to evaluate the ...
1
vote
1answer
48 views

How to wait for imperative apex call from a LWC to finish running before executing next line?

I have two methods seen below, the first method is a wired call: @wired (firstMethodCall, {param1: 'test'}) wiredResult(result){ console.log('1'); this.secondMethodCall(); ...
0
votes
1answer
17 views

How to trigger an event from another event

Sorry for the bad title, I am not sure the right way to ask this as I am fairly new to LWC and JS. I have a component which looks like below: <template> <lightning-card> &...
0
votes
2answers
75 views

Enable Lightning button after file upload in LWC

I have a lwc page where users can upload files in an object. Now, I have a requirement where the import button need to be enabled only after the file is uploaded succesfully. Till then, it has to be ...
1
vote
0answers
236 views

Migration of Onclick javascript custom links from salesforce classic to lightning

I have a custom OnClick JavaScript link that is used for Quote functionality.  The OnClick JavaScript will not work with Lightning.  How should I migrate it to lightning on click of the link a popout ...
0
votes
0answers
19 views

How to call Salesforce public api from javascript in lightning

I have created a public API in my org and I am trying to call from Javascript which is hosted as static resource in same org. But Salesforce refused to connect public api. I have tried CORS, Remote ...
1
vote
1answer
358 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-...
1
vote
1answer
65 views

LWC- Show Hide the Div tag in Template for Each [closed]

I have a custom LWC page which has table. In Column one has a Date and Column two has three Input fields and add and Delete button in Column 2. May 04th Input box type=number add Button Delete ...
0
votes
0answers
12 views

How to play an audio src in lightning component

Iam new to salesforce lightning and i need to play an audio which is a link src when a component loads and implement play and pause feature with it.
0
votes
0answers
16 views

How to dynamically apend child in LWC component to create a Page Editor

I am trying to create a page Editor, where user can select Object and fields, and they can drag and drop those fields to the dropable zone, in which I can append like below. Fieldname FieldValue ...
1
vote
2answers
53 views

How to show % values with decimals in LWC standard datatable

I have a Discount__c custom field with data type Percent(15, 3) and it has a values of 1.219% I am trying to fetch and display the value 1.219% in standard datatable under "DISCOUNT" column. { label:...
0
votes
1answer
821 views

apex:actionSupport with param is not passing updated value to controller

I have a VisualForce page that should pass the selected the value to the controller to update the record. See code below. <apex:inputField value="{!l2.Status__c}"> <apex:actionSupport event="...
0
votes
1answer
402 views

Get DOM handle for a class from parent (higher) component

Question: I want to access all the child nodes that contain class .socket-in from Higher order component (preferred) or atleast Pills. However, I've tried document.querySelectorAll('.socket-in') and ...
0
votes
2answers
458 views

Creating a User Initiated Send definition in SSJS

I am trying to create a User Initiated Send definition in my Business Unit with the following code according to the wiki example: http://wiki.memberlandingpages.com/en/documentation/exacttarget/...
1
vote
1answer
66 views

Dynaically add and remove Row in LWC

I have a custom LWC page which has date with Input Field and dynamically add and delete Button. Like Below May 04th Input box type=number add Button Delete button May 05th Input box type=...
1
vote
2answers
914 views

Using a selectRadio list to set the value of individual checkbox fields

I have a VF page on the Account. I have set up 3 radio selections using apex:selectRadio and a Script. I would now like to populate custom fields on the Account (Field1__c, Field2__c, Field3__c) ...
2
votes
4answers
2k views

Clicking button should reload the page and the callout must be performed asynchronously

My question is, should clicking a button reload a page and perform an asynchronous callout? It looks like its reloading the page after finishing the callout. Custom Button : Execute JavaScript {!...
1
vote
1answer
864 views

jQuery VF window popup issue

I want to open a popup window using jQuery after clicking on "more" button.. jQuery more/less link in pageblock table <script src="https://code.jquery.com/jquery-1.8.2.js" type="text/javascript"&...
1
vote
1answer
469 views

How can I lookup/filter rows in SFMC with a date field in the future?

Date filtering seems to either be difficult in Marketing Cloud or just poorly documented. I'm trying to filter to only show future items. Given a data extension SomeExtension with a Date field called ...
3
votes
1answer
2k views

How to check if the record is already part of the opened primary or secondary tab?

In the service console toolkit its not possible to open same record in two tabs since the tabs needs to be unique, reasons for which i understand. But i am in a scenario where in, on clicking a link ...

1
2 3 4 5
84