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

How to set the width of Toast message box in lightning component

I have a requirement where field value from long text field called Alert_Text_Timeline__c will be displayed as toast message on click of a button. Below is my code Component: <aura:component ...
0
votes
1answer
34 views

Selected Picklist Values Not Inserted When Creating Record in Salesforce LWC

I am working on a custom creation page using Salesforce LWC. This involves a custom object and picklist fields. I am aiming to insert all values upon saving, but only Name value is inserted. Upon ...
0
votes
2answers
891 views

Refresh Component When Attribute Changes

I have a primary component that has an attribute used to render different areas of the page. I click a button that updates the variable and renders the correct section of the page. However, when I ...
0
votes
1answer
26 views

Verify that an input fields matches another field on visualforce page

I have a visualforce page on the Case object that lists out assets with accessories related to the case. I have an input field where a setup technician types in the asset serial number along with the ...
1
vote
1answer
462 views

Automatically show the Choose file option/button when a checkbox is selected

Suppose I have one checkbox and one inputfile (Choose File). The idea is whenever I select/check the checkbox (checkbox value=true) then the ChooseFile (inputfile) will be automatically displayed in ...
0
votes
1answer
21 views

Error: Invalid mutation: Cannot set [value] on [array]. [array] is read-only

I have lightning playground where I have an array and for each item in the array a simple component with a remove button displays. When you click the remove button the component should no longer ...
3
votes
2answers
481 views

Javascript in custom button

I created a custom button with the send email features, so if the margin<0.4) show alert, than can't send the email. I created the button but it doesn't work. Somebody can help me? {!...
2
votes
1answer
24 views

Why am I getting unexpected results comparing currency field value in Lightning Web Component?

I have a currency(6,2) field on a custom object. I'm using @wire to get the value from the server, which if I query using SOQL the value is 0.0. However, I am getting unexpected results whilst ...
0
votes
0answers
15 views

The scenario is when i click on the 'add money' button,the money from the input should get added in the balance field which is in the wallet object

I have written this code for the above scenario:- HTML <template> <lightning-record-edit-form record-id={recordId} object-api-name="Wallet__c"> <lightning-input-...
0
votes
0answers
25 views

how to implement using an iframe paypal button in LWC and Visualforce [closed]

Hi i am trying to implement paypal checkout button using an iframe in an LWC. I have the parent LWC and I have a visualforce page where I have the paypal button. The problem is when I click the paypal ...
0
votes
2answers
42 views

Dynamically Assign Div Value in Salesforce LWC

Previously, I have table header values contained inside div element in HTML. Example: <div title="quarter1Month1">February2020</div> <div title="quarter1Month2">...
0
votes
1answer
568 views

Web Component can't find variable `require`

I am trying to use the json2csv javascript package in my Salesforce Web Component, but I get the error: can't find variable 'require'. I've uploaded the json2csv package as a static resource and am ...
0
votes
0answers
57 views

How could i remove or delete elements from LWC

I know how to create child nodes in lwc using innerHTML but if I want to remove it, what will be the way?
2
votes
1answer
49 views

Results Undefined in Salesforce LWC

I have a list of integers and trying to assign each on javascript variables. But I am getting undefined results: I am stuck on the following codes: periodLWC.html <template> <...
5
votes
1answer
721 views

event.getSource() alternative in LWC? (considering origin reparenting)

Consider below component chain in Aura: <c:parent> <c:child> <c:grandChild> When grandChild fires event, we can get hold of the source component by using event....
0
votes
1answer
46 views

How to overwrite renders in javascript from LWC?

I am working with the paypal sdk and I have had several problems, since the paypal smart button works with the light dom and the lwc works with the shadow dom. I think it is not possible to fully ...
1
vote
1answer
27 views

AggregateResult query does not return any result using Apex and Salesforce LWC

I am trying to get both starting and ending calendar years of standard Period object in Salesforce. The idea is that fiscal year starts in February of the current year and ends in January next year (e....
0
votes
0answers
25 views

How could I modify a smart button that works in the normal dom to the shadow dom

I have the sdk of the paypal smart button. I am implementing it in my lwc, I have 2 lwc. The lwc parent and the lwc child which is where I put the paypal button code. The problem is when I put the &...
0
votes
0answers
40 views

update/change apex:inputField dependent values using javascript

I have got a requirement where i am using span tag for onclick and i have 2 'apex:inputField' which is depedent on each other ex:: if i select 'India' in one 'apex:inputfield' the child 'apex:...
1
vote
1answer
569 views

How to load Tableau in Salesforce Visualforce via the Tableau Javascript API?

I'd like to load the following Tableau Javascript Code within Salesforce Visualforce. Although it works, in a browser (see codepen here), I get the below error in the console when I put it in ...
0
votes
1answer
1k views

How to check live agent availability from apex?

I've been using JavaScript to check live agents availability for a while now and it was working fine until a recent change of requirements. This is what I currently do: if (!window._laq) { window....
1
vote
1answer
520 views

Custom, dynamic highlight panel

I am attempting to create a custom highlight panel. What I ultimately need to do is on the focus of a subtab, I need an event to fire and send information to the highlight panel. The highlight panel ...
3
votes
1answer
751 views

JSForce - getting OAUTH2 refreshToken - variable app is not defined

I am clearly missing something called app here. I am following Authorization Request section from the documentation. It says your app is callbacked from Salesforce with authorization code in URL ...
0
votes
0answers
12 views

How can you prepopulate fields on VFP layout but before that allow selection of record type in Lightning?

We are trying to migrate to lightning and I've been trying to implement URL Hack, Quick actions etc, but in our specific case scenario we have multiple record types, so any of the mentioned options ...
1
vote
1answer
30 views

How to fit the lightning-map component within specific dimensions?

I have a lightning-map component that I need to fit within the div element. But it looks like the default width specified in the slds-map css is 23.75rem which is causing the map to flow outside. Can ...
0
votes
2answers
29 views

How to display Toast message with custom field value as its message

I have a requirement to display message toast on detail page when any record is opened. This message will be from a custom field (Alert_Text__c) on Account which is a text field. Below is the code to ...
1
vote
1answer
38 views

Process Indicator LWC rendering problem

Simple, yet unable to figure out why. I'm trying to highlight the clicked step by user.Something like this No matter the step is complete or not just I need to set the slds to active. But due to @...
1
vote
1answer
33 views

Accessing LWC JavaScript files in Visualforce pages

Imagine I have a JavaScript file common.js const myMethod = (arg) => { // do stuff } export { myMethod }; And I include it into a LWC: import { LightningElement } from 'lwc'; import { ...
2
votes
1answer
71 views

NoErrorObjectAvailable Script error. when selecting value from picklist in Salesforce LWC

I am trying to show/hide columns based on selected picklist value from Picklist 3 filter. Example: Assuming that value is Type 1, table should be like this: Assuming that value is Type 2, table ...
0
votes
2answers
39 views

Check if date field is empty LWC

How to check if date type lightning input is empty? I tried using a property say "dateProperty" which contains value of date input field and in JS used condition like, if (!empty(...
0
votes
1answer
16 views

Prevent click custom button when opportunity has specific picklist value

On opportunity object I have a picklist with values: 'Y' and 'X'. When opportunity has 'X' value user should be able to click button if has 'Y' when user click the button then should receive a ...
0
votes
2answers
37 views

How to get the Active tab value on UI in LightningWeb Component

I have created the custom tab as given below , how can i store the name of the active tab value in a variable in my JS file. even when user switch tab , label of the current tab should get stored in ...
0
votes
1answer
22 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
33 views

LWC wire Service empty return

I need to put an if condition on which if the wire is returning an empty : can anyone help me out for this wire(tryfh, { chadhad: '$chadhad' }) sdfsdfsdf(result) { // Hold on to the wired ...
0
votes
1answer
44 views

Are there any limitations to using lightning web components (LWC) than visualforce?

I have created the smart paypal button using the sdk in visualforce and I had no further complications using the script provided by paypal. Now I want to pass it to a lightning web components (LWC). ...
0
votes
1answer
379 views

sforce.connection.query issue

How to write the below SOQL Query in JavaSCript SOQL Query: Select Id,BillingLatitude,BillingLongitude,BillingState,BillingCountry from Account where (BillingCountry='IN' and BillingState='IN_05')...
1
vote
1answer
27 views

Records from Previous Filter Still Displaying in Salesforce LWC table

I am trying to display account records based on selected custom picklist values. Example: If selected Picklist 2 value is A, all account records having A Picklist 2 values must be displayed. For ...
0
votes
0answers
22 views

Create a Filter

I'm trying to create a custom list view in Lightning Web Component, I managed to create a data view but now I would also like to customize the filters ... so I want to reproduce the filter button with ...
11
votes
1answer
669 views

JS Synchronous Calls - Email with Attachment

I'm trying to set up a JS button on a SFDC object record that sends an email to a recipient with a specific attachment from the Notes and Attachment related object. Would I theoretically be able to ...
3
votes
1answer
2k views

download the salesforce lightning component content into a pdf

I have an issue in salesforce lightning that how can I convert the following Salesforce lightning component into PDF. We have working on something that we are able to convert the HTML page into PDF ...
1
vote
1answer
39 views

Strange Looping Issue with LWC JS

I am running into a strange looping/re-rendering issue with my client-side JS. data is an array of objects containing emailTemplate data. There are 3 objects in this case. Each has a field of Name, ...
5
votes
1answer
2k views

Programatically add focus on ui:inputText

I'm afraid I'm hitting a limit of Lightning here, but I'd thought I ask here as a last resort. I want to programmatically add focus on a field in a form. I now have code like this; Markup: <ui:...
0
votes
0answers
32 views

Disable input in Visualforce page based on picklist values [duplicate]

<apex:page controller="AddingCompetitorsDetailHWController" tabStyle="Account" sidebar="false" > <apex:pageMessages id="pgMessages" ></apex:pageMessages> <apex:sectionheader ...
0
votes
1answer
397 views

Conditional pop up based on field value

I have created a custom save button created on task edit page. On click of the button a pop up open up. I want to open the pop up only if the subject field of task contains a particular string in it. ...
1
vote
0answers
35 views

How to make font-awesome icons work on Lightning Web Components?

Downloaded the latest version of the Font Awesome Icons as a .zip file, I extract the files and uploaded the file all.css as a static resource in my scratch org. Below is my html <i class="fab fa-...
1
vote
0answers
17 views

VF Page rendered as pdf download without redirecting to any screen

I've a vf page rendered as pdf which has to be downloaded on click of a button. This button has to be present on detail page of 3 objects: Account, Contact and Opportunity. To support 3 objects, a ...
0
votes
1answer
26 views

How Do I Submit Multiple Lightning Record Edit Forms from Parent Component?

I have a parent component that references a child component within a for:each template. When a user clicks an add button, another row of the lightning record form gets added. I want one submit button ...
0
votes
0answers
24 views

Replace the Object value in Client side LWC

I have a LWC data table which has two button in each Row. Select and Remove Based on the controller Response i will show and hide buttons, For Example: If I click the select button of any Row ...
0
votes
1answer
38 views

How to include and use an external CDN in Lightning Web Components? [duplicate]

I'm trying to use an external javascript library in my lightning web component, this include two external CDNs one css and one js. How can I load them in my component?
0
votes
1answer
20 views

Not found Error when calling Salesforce Rest API for creating/fetching a Case number from Service Console

I am tying to use Salesforce Service console to fetch Cases/ Tickets via Rest API in my Node JS application. I created a an Authorization API which will provide me with the Session Id. Below is the ...

1
2
3 4 5
85