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

How to deal with Lightning input IDs changing in browser plugin?

I'm writing a Chrome plugin that fills data into some fields in the Salesforce Lightning "New Lead" page. Looking at the elements on the page it seems impossible to figure out which one is the "...
0
votes
1answer
23 views

Static JavaScript resource with LWC

LWC rookie here, How can we call a JavaScript function from LWC? For example I have the following static resource helloWorld.js and I'll like to use and call the function in the file. How can I ...
0
votes
1answer
22 views

Split records from the response.getReturnValue() to different objects like Account, Contact, Opporunities in the helper

From the controller i am returning list response, which it is having Account, Contacts, Opportunities. Attaching the response image. I need to split different objects data and assign it to different ...
0
votes
0answers
16 views

Is there a way to define the sforce.Sobject's field using a javascript variable? (ajax toolkit in visualforce)

As shown in the code comments below I want to use the variable "someCustomField" in the account.someCustomField statement but the error message tells me "someCustomField" doesnt exist despite its ...
3
votes
1answer
101 views

How to bypass immutable proxy objects when using an external and old jquery library in LWC

Please note I'm fairly new to LWC and even SalesForce (like barely 2 weeks into it). I'm trying to use SlickGrid with LWC, note that this jQuery lib was created over 10 years ago, and I got that ...
0
votes
1answer
24 views

lightning-vertical-navigation - is this right way to implement

Please help, Is this the right way to implement. HTML: <template> <div style="min-width: 225px; border-right: 1px solid #e7e7e7;"> <lightning-layout> <lightning-...
1
vote
2answers
38 views

Unable to fetch parent details from javascript button

We have a custom button called send an email at the activity level. It will work based on the case fields. Now i have a requirement to check some conditions based on a field called total active units ...
0
votes
2answers
32 views

check email not start with number and does not contain special keyword [closed]

I have use this regex but it is not working properly. function regex(){ var reg = /^[a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; } for example : 123@gmail.com or abc$...
0
votes
2answers
44 views

How to show/hide a div when clicking a link?

I'm using a Lightning Web Component. On the left side there is a hyperlink (verically listed), on the right side there is div in a form. The onclick of the link tag on the right side should be ...
0
votes
0answers
17 views

Passing contact Id to cross filters as value to one of it's criteria in tabular report, will that be possible through code in lightning?

Need suggestion on how to pass contact Id to cross filter of tabular report which is opened, when I click on custom link on contact object in lightning. We have scenario, where it is working in ...
0
votes
1answer
27 views

In LWC, an external script is loaded with an attribute “locker-data-src” instead of just src

I am trying to load an external script, the script looks loaded properly. however, can't access the object & it's methods in that script. The script is loaded with attribute "locker-data-src" &...
0
votes
1answer
38 views

Download data as Excel File in Aura Component

I have a Lightning Component that renders data in a table. I currently have the logic that downloads as a CSV file. For some users,Excel is not auto formatting the file to display as Columns. So they ...
0
votes
0answers
25 views

LWC container created on init call overriding all other LWCs already rendered with their own unique state

Situation: Up until Salesforce API got upgraded to 48.0 every time an agent would open a salesforce tab when opening a support case we were able to create a new aura:component that would trigger an ...
0
votes
1answer
23 views

LWC JS counter variable using setInterval [closed]

I have a counter number incrementing from 0 to a given number(percentage). I want to increment it in steps of one after every few miliseconds. let count = 0; let percentage = 99; let intervalID = ...
0
votes
0answers
10 views

select all option for particular list vf page [closed]

I have two lists on my VF page I gave selection all options for both lists separately. Now if I am selecting 1st list select all option it also selecting all 2nd list but I need select all option ...
0
votes
0answers
31 views

Is it possible to make the name of an aura:attribute dynamic and pass it to controller?

Currently, I'm targeting the aura:attribute by its name but the problem I'm having is when I'm setting the body of v.reactApp in my controller is setting it for all of the components that are already ...
1
vote
1answer
52 views

pass Map as parametre from lwc to apex

I try to pass a map from my lwc to my Apex controller after when i click in button every time I get null Attempt to de-reference a null object Do you have suggestions ? where i was wrong if I want ...
3
votes
2answers
60 views

Duplicate values in @track decorated array property

I am fetching data from apex class in a local map variable in LWC javascript.Even after using @track my output is getting duplicated.As in, opn calling the methods the old data is not replaced with ...
0
votes
0answers
15 views

Aura Show Image in Component in Communities

I have a requirement to show images in our Community based on who is viewing it. I've built the mapping but what I'm running into is the "img" tag isn't showing images within Communities but it will ...
0
votes
1answer
61 views

Issue when pushing to body of aura:component it pushes to the body of all aura:components rendered in DOM

Situation: Up to a few days ago every time a user would open a new salesforce tab when opening support cases I was able to create a new aura:component and push a JS static resource to the body of the ...
0
votes
2answers
35 views

How to call a function everytime on iteration in LWC?

This is my code: //myComponent.html <template for:each={myData} for:item="status"> // Do something </template> //myComponent.js changeColor(){ // Do something } I want to call ...
1
vote
0answers
28 views

Download Html + Blob image as text

On my VF page, I need to save to SF an html code with a signature represented as a blob (drawn with HTML5 Canvas) as a text file (preferably MS word). Right now, I'm not sure if this should be ...
0
votes
0answers
27 views

Getting “Undefine” in Lightning Javascript Controller on Roll Up Summary Field

I have Converted the javascript Button Using Lightning Configuration Converter, I have to Get The roll-up summary field value 'Undefined' in javaScript Controller. How I get the Roll-up Filed value in ...
0
votes
1answer
47 views

Component error in a custom sorting function in LWC

I am trying to write a custom sorting function for a data table (LWC). I have done so far below (sample) sampledata.html <table class="slds-table slds-table--bordered slds-table_fixed-layout > ...
0
votes
0answers
23 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 ...
0
votes
0answers
10 views

Opening SubTab after click

So I am trying to have a SubTab open off the Account Page when a number is clicked on (See 'onclick' in component) the account page. So, right now with current code shown below SubTab opens but page ...
2
votes
1answer
26 views

How to specify an object definition in custom metadata type

I am building an aura lightning:datatable. For flexibility I am specifying each column definition in a custom metadata type record so that when a column needs to be added or removed, have its title ...
0
votes
0answers
35 views

HTML Form on CloudPage - Conditional Q

I want to display another question on a HTML Form if they satisfy a condition. My condition is if they answer 0 to 6, another question pops up about whether they want to be contacted, but if they ...
0
votes
1answer
44 views

'set' on proxy: trap returned falsish for property 'id' — for an object in memory

I am getting the above error when trying to update a particular value of an object in memory. I understand I can not make changes to objects gathered from an @wire property. However, this should not ...
0
votes
1answer
56 views

Using variables in LWC

I'm trying to prepopulate a field in a lightning web component to create new records and just not sure how to do it. import { LightningElement} from 'lwc'; import ACCOUNT_OBJECT from '@salesforce/...
1
vote
1answer
33 views

Proper namespace syntax for importing static resource into LWC?

I have a static resource named 'myResource' that contains a javascript file 'myfile.js' I can correctly import like this: import myResource from '@salesforce/resourceUrl/myResource'; Then when I ...
1
vote
1answer
37 views

Checking for a Permission Set Apex/JavaScript/Lightning

I am currently trying to check for a user for a permission set. Currently I have a permission set to give view access to a details object page. Users can access page by clicking on a number link on ...
0
votes
1answer
42 views

Adding none to combobox

I'm trying to use the below example to add a value to combobox dynamically, but I'm running into errors. Option to select none in picklist fields lightning-combobox - LWC <lightning-...
2
votes
1answer
68 views

LWC call Apex method with parameters

New to LWC and looking to call an Apex method and get data to display. It seems I'm missing something here. I get nothing back and don't see any error. Is there anything I'm missing? Javascript file: ...
0
votes
2answers
56 views

How to play a video in a pop-up window when the user clicks on the video in an Aura Component

I am using iFrame to play a video, but the video runs on that page/screen itself. But I want that when the user clicks on the video a pop-up/modal screen comes where the user can watch the video. I ...
2
votes
1answer
40 views

Lightning component: Invalid Literal Value[1,1]: Javascript :Getting the below error at random when opening the component in ipad salesforce1 app

i have created a lightning component and that component is dynamically created and called from another component using $A.createComponent( dynamicComponent, I am getting the below error at random ...
0
votes
2answers
44 views

LWC Salesforce Get Parent in Datatable Column

I know that this question is out there however I am still a bit stuck. I am trying to make this as simple as possible. I am trying to make the Parent Value show in my Lightning datatable. Show ...
1
vote
1answer
25 views

Aura component get map value using dynamic key

From my understanding of javascript, I should be able to query for map value using key using following code: consts = {'key' : 'value'}; var stringKey = 'key'; var something = consts[stringKey]; ...
-1
votes
1answer
36 views

marketing cloud - can I use a third party javascript library inside email?

I need to use a third party javascript library inside email that is triggered after clicking on a button inside the email. I need to convert my email to pdf and allow a user to download the pdf ...
0
votes
1answer
42 views

Unable to call Child LWC from Parent

I have a child LWC named pCom_PANS I want to call it in another LWC,So I tried the snippets <c-p-com-pANS></c-p-com-pANS> <c-pCom-PANS></c-pCom-PANS> <c-p-com_PANS>&...
0
votes
1answer
20 views

Unable to disable edit access for a field in visual force page

I'm trying to remove edit access for a field for the users with specific conditions. I've tried with input text & disabled tag working perfectly fine but I've faced some issues with some users due ...
0
votes
0answers
22 views

Javascript proxies were not generated for controller {MyApexClass}: may not use public remoted methods inside an iframe

I have an apex controller for a VF-page. I got this error couple of days ago. I got this error on my UAT-org but not on my dev-org, even though both are running on the spring 20' release. if I ...
16
votes
2answers
340 views

Is there a maximum result size for @AuraEnabled Apex methods for Lightning Aura components?

I have a Lightning Aura Component with an Apex Controller selecting a (kind of) huge amount of data. It is querying a custom object elfBCProject__c with a sub select on a child object ...
0
votes
1answer
67 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
0answers
20 views

OpenCTI for a third party domain

I want to give a third party to write the softPhone HTML file. Inside the HTML they should use the OpenCti.js library. The below link will work only from VF page. <script src="/support/api/48.0/...
0
votes
2answers
66 views

How to pass value to date parameter in apex method from LWC JS?

Please provide a proper way to call this method from LWC passing date parameter. public with sharing class ApexClass { @AuraEnabled(cacheable = true) public Date string apexMethod(Date z) { ...
0
votes
0answers
21 views

Lightning Locker Service is not allowing to use Web3.js library in lightning components

I have a requirement to use web3.js library in my lightning component but lightning locker service is not allowing to use that library and i am getting following error: "Custom Script Eval error in '...
0
votes
1answer
30 views

Custom lightning component disappears without errors in log, when button clicked, but only in production

I have the same lightning-button-stateful onclick event handler in the sandbox and in production. _handleSectionExpandCollapse(event) { let content = event.target.parentElement; event.target.selected ...
0
votes
0answers
26 views

Unable to read SObject in LWC

I have a problem which I think could be an LWC bug. I need to pass an object, in this case a contract, which I get from @wire getRecord: have seen that there is a similar thread, which reports ...
0
votes
1answer
29 views

OnClick Javascript button to update custom fields

Below is the JS code I've used to update the status field on order object when clicking on custom cancel button. The issue i am facing here is when clicking on cancel button, confirm pop up shows up ...

1 2 3 4 5 80