Skip to main content

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
1 vote
1 answer
23 views

Test LightningCombobox in jest

Im having a lot of trouble trying to read the options coming from a combobox when i select it. Ive tried to move the options to a @track variable making the call for the options just simply return ...
0 votes
0 answers
17 views

AES Decrypt in Salesforce over 1MB

Has anyone used JS in SF to view encrypted (standard apex encryption) file which is >1MB? I came across this link but unsure if it will work using LWC in Salesforce. Iam looking for similar ...
1 vote
2 answers
1k views

Lightning Input Readonly not working?

I am passing the value for the readonly attribute from the parent to the inner child lightning input. Parent cmp: <c:Childcmp isReadOnly="{!v.isReadOnly}" /> Parent ctrller: handleEvent : ...
0 votes
0 answers
19 views

Embedded messaging deployment snippet to load as a portal User

I have explored the Embedded Messaging deployment and so far what I understood is what I am looking for is not possible to achieve but need help if there is any workaround to achieve following or if ...
0 votes
1 answer
2k views

LWC Tree grid ontoggle action triggers onrowselection

This is how I am using treegrid component. When I expand a treegrid row, and then collapse it, automatically onrowselection event is fired, which calls onRowSelection action handler in JS controller ...
2 votes
2 answers
1k views

DatePicker Issue

I have two text field: One normal text field that accepts numbers. <apex:inputField value="{!FinancialAssCont.Down_Payment__c}" styleClass="form-control downpaymentAmount" onblur="...
0 votes
1 answer
1k views

Populate input field with data LWC

Hello everybody I am currently working on a Flow that receives the Id from the record where the LWC action is and pass it to the LWC. The LWC is a form that shows some lightning-input and lightning-...
3 votes
1 answer
1k 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' }); ...
8 votes
2 answers
4k views

How to dynamically import a module in lwc

I am trying to import modules dynamically in my LWC component. While pushing the change I get a strange error LWC1509: This experimental syntax requires enabling the parser plugin: 'dynamicImport' ...
0 votes
2 answers
30 views

How can I check if a variable is declared in "this" or not?

I am developing a function to assign a value to a property of this in Lightning Web Components (LWC) by passing its variable name. Additionally, I need to raise an error if the property is not ...
-1 votes
0 answers
32 views

I want Available records in DE to get populated in Cloud Page Form using Ampscript?

The question is I have one DE where the records are getting populated on Daily basis from that DE I want the records to get populated in my cloud page where I created a Form page in that dropdown I ...
2 votes
1 answer
1k views

How to change the value of a input field on select

I am trying to update the selected value from pop up to the input fields. But the value is not getting reflected on UI. If any one have any idea please help below is my code HTML <template> &...
1 vote
3 answers
6k views

Download file(Image/Doc/PDF) in Lightning component

I have an url of the image(Not from salesforce) which is stored in another system. Can i download that file by providing link to the URL in my Lightning component ? I have tried with "**lightning:...
1 vote
1 answer
791 views

how to get the owner of a data extension in marketing cloud [closed]

Is there any way to get the owner of a DE through API or Query?, Currently we have have a SOAP API but this is not bringing us the Owner, this would be the only attribute that does not call
2 votes
1 answer
4k views

Unable to Close Drop down menu on Outside click in LWC

I am unable to close the dropdown menu in LWC on clicking anywhere else on the page apart from the dropdown menu . Please find the code below , HTML Code : <a class="userStyle" role="button" ...
2 votes
2 answers
8k views

Wait for Promise to finish executing in Javascript Function

I am calling a javascript function getSObjectfromRecordId and passing in an ID such as "0035f00000DrrSdAAJ". When the function getSObjectfromRecordId calls the apex method getSObjectFromID, ...
0 votes
1 answer
1k views

LWC reopen the same tab with workspace API

Hi I need some assistance for one of the scenario, i am trying to open a LWC from another LWC in which target LWC is Wrapped inside the aura component. the problem is that whenever user clicks new tab ...
0 votes
1 answer
37 views

LWC : [Cannot read properties of undefined (reading 'write')]

I have following LWC component which keeps throwing " [Cannot read properties of undefined (reading 'write')]" error. I have tried everything to check that record is being pulled and new ...
0 votes
1 answer
1k views

LWC Lightning Record Form Submits on Enter in Input Field

This may be default behavior, but I'm having an issue with using the Lightning Record Form. Basically, if the user is inputting data into a field and presses enter the form will submit. I don't see an ...
0 votes
1 answer
1k 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 ...
2 votes
4 answers
5k 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
1 answer
2k views

How to import parent object field in lightning record form of child custom object?

There is Contact object as parent object and I have created a custom object called Vaccination_Information__c which is a child of Contact object. I want to include the contact name field from Contact ...
0 votes
0 answers
32 views

Display error message and character count in same line below in lwc

I have a requirement to display a character count underneath an input field, which is a required field. However, I'm encountering an issue: when the user does not input anything and the error message ...
0 votes
2 answers
2k views

Regular expression to check does a string contains any special symbols not working in lightning javascript

i am using the below code var value = 'abcd$'; var regularExpression= new RegExp('[-!$%^&*()_+|~=`{}\[\]:";\'<>?,.\/]'); if(regularExpression.test(value)) { //true } else{ false } ...
0 votes
0 answers
21 views

Third party javascript libraries and keeping them up to date

So our org uses a multitude of third party javascript libraries; for example jquery and usually stored as a static resource. One problem is sometimes these are used in externally facing components, so ...
0 votes
0 answers
18 views

How to make fields readonly in Chat SnapIn of Salesforce?

I am using the below code for is there anyway to make FirstName and LastName readonly const initESW = function(gslbBaseURL) { // eslint-disable-next-line no-undef embedded_svc.settings....
1 vote
0 answers
51 views

MCP (Personalization) SDK / sitemap which namespace to use and how to configure sitemap for multiple domains

In MCP (Personalization) SDK / sitemap, when we are reviewing the namespace, examples are supporting both: SalesforceInteractions & Evergage https://developer.salesforce.com/docs/marketing/...
2 votes
2 answers
100 views

Issues using jsPDF library in an LWC

recently in our org we have needed the ability to create PDF files. I am aware you can do this using visualforce pages with the render as PDF method, however we would like the pdf to be styled more ...
0 votes
1 answer
97 views

Stop lwc timer when console tab changes

i have a lwc on record page which calculates how much time the tab is active and work is going on . when i am switching the tabs which are standard console tabs on Case object , i want timer should ...
0 votes
2 answers
6k views

SSJS Rows.Retrieve not returning any rows

I'm having an issue where I'm unable to retrieve any rows from a DE that I know is populated inside an automation. Here is my code: <script runat="server"> Platform.Load("core","1"); var ...
0 votes
2 answers
2k views

Variable Undefined...But it Really Is

I'm working in a Lightning Aura component, and when I run it in the browser it's saying that my element is undefined. HTML <div id="myElement"> ... </div> Controller.js ...
0 votes
0 answers
16 views

Kakao JS SDK Calls in Salesforce

I'm trying to develop a Salesforce component that makes a request to KAKAO API using the KAKAO JavaScript SDK. this is my lwc Javascript code to initiate Kakao App import {LightningElement} from 'lwc'...
1 vote
2 answers
2k views

How to get picklist values based on record type in javascript VF page

I am using Javascript to get picklist values(dependent or normal picklist).Its working fine. But the problem is i am getting all the Picklist values for that object. I have to get picklist values ...
3 votes
2 answers
17k views

Select Child Component in LWC when it is present multiple times

I have a parent component, which contains 2 re-usable components. I am not sure how to fetch them in parent. Parent Component <template> <lightning-card title="Case Reason"> &...
1 vote
0 answers
45 views

Child component need to re render after value changes in parent component

I have 3 components. Grand Parent --> Parent --> Child. When ever data changed in Child LWC I need to Re-render the Child LWC which is inside Parent LWC. I have tried GET SET methods also. But ...
3 votes
1 answer
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 vote
1 answer
1k views

Javascript error on Button click

I am using one custom list button on one of the related list. But sometime when I click on this button I am getting the below error message: A problem with the OnClick javascript for this button or ...
1 vote
1 answer
44 views

Connected Callback and RenderedCallback not getting called 2nd time

I have this below service console tab. On the right side i have added a lwc on page refresh if i try to swtich between tabs i can see connectedcallback and renderedcallback is getting called. but 2nd ...
0 votes
1 answer
26 views

Apex call returns successfully after errror, resulting in issues

I have an Apex call which causes an error (ENTITY_IS_DELETED, but it doesn't matter which error it is). I might be able to fix that error, but now it somehow also returns successfully anyway, so the ...
4 votes
0 answers
43 views

JAWS reading the error message twice in lightning input LWC

JAWS reads the error message on the lightning input twice, because of the presence of both aria-errormessage and aria-describedby attributes. Values for both attributes are the same. How to resolve ...
1 vote
2 answers
884 views

How to enable the increment and decrement arrows in an <input> element of type "number" in lwc?

<lightning-input label="Units" type="number" step="1"></lightning-input> Above is my code, but it is only creating an input which increments/decrements with ...
1 vote
1 answer
1k views

LWC vertical progressbar - problem in Previous and Next button logic

i am new to lwc, i created a component for vertical progress bar, but i am facing issue in previous and next button. 1.Next button works from a to e, ( a->b>c->d->e), but for the last ...
0 votes
1 answer
934 views

Not able to use ExcelJS.min.JS in Lightning Web Component

I have uploaded ExcelJS.min.Js file in the static resource as XLSX name. I want to import and use its functions in LWC. Here's my code and I am getting 'undefined' error at this line - await ...
0 votes
2 answers
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
1 answer
1k views

why @track list doesn't rerender after value is changed?

i have a list of sobject that is retrieved from the db thanks a call to an apex method tha return the list, the list is retrived async with a the setInterval function . //this is the sample of the ...
0 votes
0 answers
52 views

Beforeunload unexpected behavior in LWC

Im trying to publish a platform event from a LWC if the browser tab gets closed or the browser itself gets closed. It works fine for both of the cases, however if I repeteadly click on the refresh ...
0 votes
0 answers
28 views

Lightning input validation blocking the button click

I have a lightning input configured like below <lightning-input type="text" label="Phone Number" name="Phone Number" ...
0 votes
0 answers
30 views

$A.get('$SObjectType.CurrentUser.Name') is undefined

I am using a script in the head markup file in the experience cloud. $A.get('$SObjectType.CurrentUser.Email') works fine, but $A.get('$SObjectType.CurrentUser.Name') returns null. I tried debugging it,...
1 vote
3 answers
6k views

How can I load jQuery in LWC?

For the convenience of the user, I'm implementing the requirement of katakana is automatically entered when entering hiragana or kanji in Japanese using this JavaScript library. You can check the ...
2 votes
1 answer
1k views

Capturing a Flexipage Lightning Tab Change

TL;DR Is there a way to capture / fire a lightning event to know a tab has changed when using the standard flexipage / lightning tabs component? We're trying to design a reactive page that has ...

1
2 3 4 5
112