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
215 views

onchange event not triggered on removal of last character - LWC

I need to display the count/length of string entered in a text box as and when changed(addition/subtraction of new characters) using LWC <template> <lightning-input ...
0
votes
1answer
21 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 ...
3
votes
2answers
5k views

Can I reference a Static Resource in an HTML Area?

I'd like to reference a Javascript file (Static Resource) in an HTML area within Salesforce - is this possible? Or can I only reference Static Resources from a VisualForce page? If it is possible, ...
0
votes
1answer
22 views

Multi selection allowed failing in object describe

My code fails for multiselection of describe object iam getting following error. System.NullPointerException: Attempt to de-reference a null object Error is in expression '{!showFields}' in ...
4
votes
1answer
75 views
+50

How to use polyfill in visualforce component?

Link to polyfill: https://github.com/jonstipe/number-polyfill The polyfill is to allow increment decrement buttons in Internet explorer for I added the .js and .css file from the polyfill as a ...
0
votes
1answer
408 views

Mass edit page dependent picklist

We're using the 'mass update and edit' salesforce app off the appexchange for mass editing accounts and I'm looking for a way to dynamically display the dependent picklist based on the controlling ...
1
vote
1answer
422 views

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

Date filtering seems to either be difficult in Exact Target or just poorly documented. I'm trying to filter to only show future items. Given a data extension SomeExtension with a Date field called ...
4
votes
2answers
2k 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 ...
0
votes
3answers
617 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
19 views

Having trouble removing the selected option from a picklist and reloads another picklist without the item?

I've made a picklist that keeps on being added when click on the add option link but the javascript I'm using keeps throwing an error of cannot read property "options" of null <apex:variable value=...
3
votes
2answers
214 views

How to run “ $('div').clone().appendTo('.wrapper'); ” in LWC? [closed]

I want to achieve this in LWC. I want to call the same HTML content (ex- div, p) multiple times in iteration & append them one below other as shown in above link. I used this $('div').clone()....
2
votes
3answers
2k views

Binding a click event to document Lightning Component

I am using SLDS Picklist in Aura Component, I am trying to close the picklist when user clicked outside the picklist. I am trying to bind a click event to document and call the action to close the ...
0
votes
1answer
13 views

ID Property passed to child changes value

I'm quite new to lwc's and i'm having an issue where the property passed down to a child component, specifically an ID, the id value in the child component has (-71) appended to the end of the ID. ...
6
votes
1answer
2k views

querySelector not getting element in lightning web component

I am creating a popover, where I need to position it correctly based on the button's position that triggered it. It starts like this: <div id="popoverWrapper" class="popover-wrapper" style={...
0
votes
0answers
14 views

How to save a text field based on user input

I have created a LWC that displays a table of information for a user. I created a html lightning input, that looks like this. <td><lightning-input key={row.key} data-key={row.key} value={row....
0
votes
2answers
2k views

Change Date Format In Lightning?

From lightning component, when I select the startdate and end date, I should able to select in MM-DD-YYY. But from backend Apex, it is coming as YYY-MM-DD 00:00:00. I want to convert this into that ...
0
votes
1answer
18 views

use of lightning navigate:navigate from one component to another in lightning community

var eUrl= $A.get("e.force:navigateToURL"); eUrl.setParams({ "url": url }); eUrl.fire(); I am trying to replace above in my code as per documentation it is not ...
3
votes
3answers
597 views

Is there a way to mass-check Checkboxes when updating a Profile's Object's Field Level Security?

Is there a way to mass-check Checkboxes when updating a Profile's Object's Field Level Security? When setting Field Level Security for a Site's Profile (or any other Profile), I have some objects ...
0
votes
0answers
11 views

AJAX Proxy Basic Authorization

I tried to make a SOAP call to a web service through AJAX Proxy (in a visualforce page) but I can't configure the basic authentication in the header. Does anyone know how to do it? Here is my code: &...
2
votes
1answer
476 views

SOQL query to find out if user exists in public group in Javascript

Can anyone help me to query whether the current user is a member of public group in Javascript button on click. I've gone through many blogs but nothing struck to my eyesight which will be of help. If ...
3
votes
1answer
136 views

Some users get the error “Unable to set property” when clicking a custom Javascript button

Since a couple of weeks, some of my users have a problem with a custom Javascript button in Classic. They get the error message "Unable to set property 'innerHTML' of undefined or null reference". No ...
0
votes
2answers
656 views

event.target.value returns [object object] on onClick

component pseudo code <aura:iteration var="PIW" items="{!v.objInfo}"> <thead> <tr> <th> <button ...
0
votes
1answer
503 views

More detailed error reporting for SSJS failing?

We have a script which runs in an automation which retrieves registration data from our events management platform. The automation recently stopped working, and the problem was with the javascript ...
1
vote
0answers
20 views

ActionHub (Mass Edit + Mass Update + Mass Delete) Lightning Customization?

We are currently migrating from Classic to Lightning. Our ActionHub Mass Edit + Mass Update + Mass Delete AppExchange package customizations rely on copy/paste of JavaScript for unincluded default ...
0
votes
0answers
17 views

Lightning data Table onrowaction

I am trying to use lighting Datatable with a button to edit record. I am trying at first to assure that when i click on the button catch the related record. But when i click edit button i got nothing. ...
4
votes
1answer
18 views

Why do I get a “lwcX is not a constructor” error at runtime?

I have two "headless" LWC modules (LWCs that have no template or CSS and that simply export some items to be used elsewhere). Let's call them "lwcX" and "lwcY". In this case lwcX is the default ...
1
vote
1answer
376 views

Can we inject javaScript on standard edit page of contact object?

I have a requirement to make callout from standard edit page of the contact object. Is it possible to inject javascript on standard inline edit page or standard edit view page.
0
votes
1answer
1k views

how to pass parent objects's id to custom button dynamically so same button can be used for all objects

I have a custom button on task related list of Account Object. The button contains the URL as: /apex/GetDynamoDBTasks?id={!Account.Id} Where GetDynamoDBTasks is a Visualforce page. I want to pass id ...
5
votes
2answers
315 views

Accessing JSON fields in html of LWC

I am calling an external system from an @wire method and it returns a json string. When I parse the json into an object I am able to use dot notation to access fields from the json object in JS but ...
0
votes
1answer
25 views

Component Helper Async Issue?

I have a component that is using aura:iteration to loop through some data and output a table of results. One column in this table is a link to the record. I created a clickevent handler and a helper ...
1
vote
1answer
483 views

Rerender does not work with Modal

I have a VF page which gets the folder name from the user and creates a folder in one library. The page has a button & the folders existing the library is shown using a repeater. when the button ...
6
votes
0answers
36 views

Is it possible to render an LWC template identfied by file name that is only known at runtime? [duplicate]

This Render Multiple Templates code example shows how to pull content from multiple .html files in the same component: import { LightningElement, track } from 'lwc'; import templateOne from './...
0
votes
2answers
28 views

Open Link in the same window below button in VF page

I am looking for a solution where when I click on a button, the resulting page should open in the same window below the button. Below is my current VF page, right now the page is opening in a new tab. ...
0
votes
1answer
373 views

Saving Lightning Select Value

I'm trying to display a drop down on a custom component and once a value is selected I would like to update the value in the database. I'm finally able to load the values from the database, set the ...
0
votes
2answers
489 views

<apex:actionFunction not calling Apex methods

I am trying to call an apex method from my visualforce page using javascript method. <apex:page docType="html-5.0" showHeader="false" expires="" sidebar="false" title="Connection" controller="...
1
vote
1answer
450 views

Use JSForce to connect with a community/portal user

it possible to connect to sales force with a community license user using jsforce? This is what I have tried let conn = new jsforce.Connection({ loginUrl : 'https://login.salesforce.com' }); ...
0
votes
1answer
35 views

Triggering the approval process from JavaScript in Lightning Web Component

I have a quick question on approval process and I would like to get your suggestion on how to implement this particular requirement. We are developing a custom lighting web component for our ...
0
votes
1answer
21 views

How to fire appEvent after toastEvent in lightning controller

I have an appEvent on a child controller to update a parent method after a toast. I have set an alert on the parent in the parent method to figure out if my event is working properly. My alert shows ...
0
votes
0answers
27 views

FullCalendar v4 events displayed on popover doesn't trigger eventClick method [closed]

I have a custom development with FullCalendar v4 js library implemented. This is my calendar settings object: locale : 'en', plugins : ['dayGrid','timeGrid','list','interaction'], ...
0
votes
2answers
630 views

error while trying to build a chart in lWC

I am trying to build a chart LWC using Chartjs javascript libraries. I keep getting error when I try to build the chart: C is not a function Below is my component Js : Import { LightningElement,...
4
votes
2answers
544 views

Stripe integration for Salesforce in lightning components

We are trying to implement Stripe integration with Salesforce by using Lightning Components for payments. Stripe use an API for securely obtain the users card information. This API is for the client,...
1
vote
1answer
129 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
1answer
19 views

Cannot assign to read only property 'disconnectedHandler' of object '[object Object]

I am trying to work with a timer in Salesforce Lightning. When I add it to the page, it throws the error of "render threw an error in 'c:serviceConsoleCaseTimer' [Cannot assign to read only property '...
0
votes
1answer
367 views

FormAssembly Using JavaScript to fill in fields based on an Event Select change

can't seem to get the select change to update the location field based on the repeater location section. No errors it simply does not change the location(tfa_4) drop-down to equal the repeater ...
0
votes
2answers
29 views
0
votes
1answer
10 views

Notes not getting saved due to html characters

I am trying to escape all html characters with this function : strNotes.replace(/&/g,'&amp;').replace(/'/g,'&apos;').replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/...
0
votes
2answers
388 views

Change the title of a slds button in JS controller

Maybe this has been asked before, but I was not able to find it anywhere. I am trying to change the title of the slds button on click through controller. I am trying to get the current title through ...
0
votes
1answer
369 views

want to hide first column while exporting data to csv

want to hide first column while exporting data to csv; Am using this code: plz help me out: <script type='text/javascript' src='https://code.jquery.com/jquery-1.11.0.min.js'></script> ...
1
vote
1answer
490 views

Issue in console event listener

I have recently enabled omnichannel in our org. I need to perform some action when an agent accepts a post from the omnichannel widget in the console. To do this I added a hidden custom console ...
0
votes
1answer
410 views

I am getting error when i was open my visualforce page in safari , Ipad ,Iphone

My lightning component is open through a visualforce page. It work fine in Chrome ,Firefox and IE web browser. But when we open this visulaforce page in mobile or in safari browser it give error ...