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.

0
votes
0answers
9 views

Place embed einstein bot in other website (not in force.com)

Firstly, i have used the Einstein Bot embed code to VF page, it work perfectly. (the embed code is generated by Salesforce automatically, in Snap-in). Then, my customer wanna insert embed code into ...
0
votes
2answers
64 views

How to validate all fields with different aura:Id?

I am trying to validate all fields when the user click's on the submit button. Issue: I had to maintain different aura: id's for the lightning input elements, due to some other logic needs to be done ...
0
votes
2answers
693 views

Refresh the page twice in Salesforce with Javascript

<script> window.location.reload(); </script> The above code makes the Salesforce page to keep in the reload state when I add this visualforce page as a page layout. I would like to ...
0
votes
1answer
16 views

Visualforce commandLink not working when opening in new tab

I have this commandLink in my visualforce page <apex:commandLink value="{!Order.Name}" onclick="window.top.location='/{!Order.id}';"/> When I simply left click the link it redirects just fine. ...
3
votes
1answer
36 views

When and why do I need to perform an .isValid() check?

This document - Modifying Components Outside the Framework Lifecycle - says the following: You don't need a cmp.isValid() check within this setTimeout() call as the cmp.set() call doesn't do ...
0
votes
0answers
18 views

Make child rows selected on selecting parent row - lwc tree grid

Is it possible to implement the logic - when parent row is selected all its child rows are selected as well with lightning web component and tree grid? HTML: <lightning-tree-grid key-...
4
votes
1answer
50 views
+50

When and why to use $A.reportError?

In the documentation Using JavaScript Promises it is mentioned To show an error message in a catch() method, use $A.reportError() Why would I want to use $A.reportError that at all? I could use ...
1
vote
1answer
29 views

Renaming LWC const variable breaks component behavior

I was surprised to find that changing the variable name for a JS const from fields to CONTACT_FIELDS caused my component to stop functioning. (I realize this is a naming convention for Java constants, ...
1
vote
1answer
443 views

DocuSign Integration Java Script Button

I have a button that when fired sends the document to ALL recipients at once. The Roles on the Template match the DuS Admin Setup Roles in SF. The email addresses shown are just for testing. Below ...
0
votes
0answers
17 views

How to reload custom lightning component in a lightning page tab every time I click on the tab?

I have one lightning component named "Add/Edit Invoice Line Item" (as seen on screenshot) I want to reload this component every time a user clicks on this tab. Is there any way or event which can be ...
4
votes
1answer
61 views

How can I dynamically assign a value to a lightning record form?

For example, my component has the following section that displays a record form: <template if:true={showRecordForm}> <lightning-record-form object-api-name={sObjectApiName} ...
0
votes
1answer
25 views

How to implement a landing page to create a Contact record in SalesCloud

I need to create a Landing Page Web Form in Marketing Cloud where once the user submit the form some REST API code will be executed to create some object records in SalesCloud (Contact + Asset + ...
0
votes
4answers
46 views

Unable to pass parameter to apex controller

@AuraEnabled public static List<RecordType> getDesc(string sObjectParam) { recTypes = new list<RecordType>(); for(RecordType rtd : [Select Name, Description FROM RecordType where ...
0
votes
1answer
23 views

Why is javascript class property is showing as Proxy object in getter

Following is the javascript code I wrote for one of the lightning-web-component. When I am trying to use getter function in HTML, the component is throwing an error Cannot read property 'length' of ...
0
votes
1answer
404 views

How to prevent outputpanel from rerendering when javascript is fired

I have a lookup field that inserts a row of fields onto my page. I have an outputpanel that surrounds the html which needs to be rerendered. The problem is, inside that outputpanel I have a few ...
-1
votes
0answers
11 views

i am trying to use/manipulate apex:pageblocktable data from browser local storage [on hold]

will it cause any issue? security related. if there is any other way to modify the pageblocktable that initialised by .dataTable.
0
votes
2answers
445 views

Internal server error: Lightning components basics, Event step

I encounter an issue with one trailhead from salesforce : Lightning components basics. I finished the previous chapter about be "connected to Salesforce with server-side" and the project worked. Now ...
1
vote
1answer
505 views

Accessing the DOM returns null in lightning component

Somewhat new to Salesforce. I have a lightning component that has an iframe in it. The component will be in the lightning communities. There is a method in the controller that gets called once the ...
1
vote
0answers
28 views

How to use LWC in markup that is dynamically created by third party libraries?

I'm using Leaflet, a third party mapping library. Leaflet dynamically creates tooltips for each map feature. You can write custom HTML for these tooltips, but I want to use a LWC component there. Here'...
0
votes
1answer
22 views

Display a Pardot Custom Field on Thank You (Code) page of Form

I have a Pardot form where the person enters an Account# (field is populated already in Pardot). They hit submit, and I'd like the Thank You text in Pardot to display another field of their's based on ...
3
votes
1answer
28 views

Confusion around Blob size when using String.fromCharArray

Some context: I'm trying to upload files to Sharepoint through Salesforce. The file is read clientside with a FileReader and its readAsArrayBuffer method, the result is converted to a Uint8Array, ...
0
votes
0answers
7 views

Redirect to previous default page Community

I wish I could get the value from the previous URL on the community page. I have this community page: Note: The related list "HipoteseDiagnostica" is a component and the "New" button is another ...
1
vote
1answer
465 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 ...
1
vote
2answers
438 views

Visualforce Search Page - Dependent Picklists

I'm working on building a custom search visualforce page and I've run into a problem. I have added 2 picklists (one controlling and one dependent) as filtering fields. However, when I go to the VF ...
1
vote
1answer
379 views

Simple Popover Example Causing: “Cannot read property 'na' of undefined”

I'm trying to get the popover example from the Salesforce documentation working and it's giving me an interupt error with "Cannot read property 'na' of undefined" message. All I have done is copy ...
0
votes
0answers
28 views

Access Check Failed! AttributeSet.get(): attribute 'loadMoreStatus' Error after spring 19 release

Receiving below errors from javascript once i click 'view more' on related list Access Check Failed! AttributeSet.get(): attribute 'loadMoreStatus' of component 'markup://c:RelatedListWindow {6525:0}'...
0
votes
1answer
30 views

How can I overcome a “session is not valid for use with the API” error when accessing AJAX Toolkit as a Community user?

I'm attempting to use the AJAX Toolkit to access the current Account ID of the logged-in user from within a community site. (The particular community is managed by Nimble AMS, and is referred to as "...
4
votes
2answers
257 views

The first parameter of loadScript() and loadStyle() must be an LWC component

I have a strange problem with the component and I don't know what more can i do, I'm having this problem whenever I put the lwc inside the recordPage of a custom object but in a standard recordPage ...
1
vote
1answer
423 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
0answers
14 views

issue in creating record by hovering on related list link

i have a javascript button (OverRidden the standard create contact button)to create a contact record from account detailpage, which opens a vf page in model window and after clicking on save the ...
0
votes
0answers
14 views

Closing a vf page properly

I have a modal that uses an iframe which leads to a vf page. There is a cancel button that I created whose functionality is to close the page. I have tried window.top.close. Any other reccommendations ...
0
votes
1answer
517 views

SSJS script does not update a Data Extension field when using running the script via the Script Activity in Marketing Cloud

I am trying to run the script below in the Marketing Cloud Script Activity to update data in a Data Extension: <script runat="server"> Platform.Load("core","1"); try { var ...
0
votes
0answers
16 views

Stop 3rd Party Integration from Changing Record Ownership

We are using a 3rd party app to have incoming emails send to SF under our custom Messages Object. However, the app also changes the ownership of the record to the themselves when a user clicks to view ...
5
votes
1answer
74 views

Any ways to extend a component's template in LWC?

In Aura there was a way to extend component and it's template. Extending component's template would go into {!v.body} slot from the parent component. In LWC we can nicely extend components code by ...
0
votes
1answer
632 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....
0
votes
0answers
9 views

Redirect in Salesforce1

I would like, after the click of a button on salesforce1, the visualforce page to go to the details page of the object. Example: I have the following visualforce page: After click on "Saver" button ...
3
votes
1answer
561 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 ...
13
votes
1answer
558 views

Lightning Components: Why is the rendering of 3-level nested <aura:iteration>'s so slow?

I have been working with a nested iteration and it is causing a delay of >3 seconds AFTER loading things from the APEX controller. The APEX response itself is fast, so I'm not looking for any APEX ...
0
votes
1answer
18 views

Google reCAPTCHA on Visualforce - server side verification

We have the Google reCAPTCHA all set up and working (in other uses in our org), but I'm having trouble getting it to work on my VF page. Clicking the submit button fires the recaptcha and I get a ...
2
votes
1answer
29 views

Getting error function not defined while it's there

I need to call the jsPdf function, however in the console I am getting genPdf is not defined. Here is my code-- <apex:page controller="GenerateQuoteController" standardStylesheets="false" ...
3
votes
1answer
459 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? {!...
0
votes
1answer
435 views

Get values from child page

I am creating an custom vf page for opportunity. I am having 5 input text box which has an lookup. on click of this lookup an pop up should get displayed(i.e custon child page) and should select ...
0
votes
0answers
11 views

Javascript message disappearing due to mitel phone app loading in side bar

I'm trying to show a pop up message when a field equals a value. I used a javascript alert for this, but when the page loads the message displays for a few seconds and disappears. The only way I've ...
0
votes
2answers
1k views

Cannot read property 'setParams' of null

my set params is null for some reason. But the variables i'm passing in do have values. I have a console.log before I set params to check before the parameters are set to their values. Can anyone ...
0
votes
0answers
22 views

get div Id inside Apex:pageblocktable using Jquery

I am creating a heirarchical structure between account and contact using pageblocktable within another pageblocktable. I have a div tag that is holding the contacts pageblocktable for each account. On ...
1
vote
1answer
40 views

convert this javascript code to work in lightning

The Sales representatives in my company can log into an user profile by clicking on a custom link in SF classic which is an on click java script and when clicked on that link the representative is ...
1
vote
1answer
21 views

Trigger addError('blah') -> Lightning Components JS alert('contense of addError('blah')')

I am sure my Title does not help much, but not sure how to shorten this question concisely. I have a Lightning Component that has the ability to update a case record. I have an APEX Trigger that ...
0
votes
1answer
17 views

How do I replace all non-digit characters in a regex except for the period?

In my VF page I have some Javascript to format passed variables. I have a string eg "Cost is $100.00" from which I need to remove all non-digit characters, EXCEPT the digital period. I want the result ...
0
votes
0answers
10 views

setInterval spikes on Visualforce Page / Works on other HTML Pages

I am trying to use javascript's setInterval() function to create a timer that actions at certain times, however the following Javascript which works outside of Visualforce, jumps from 0 to a random ...
0
votes
0answers
344 views

Javascript alert disappears after few seconds in visualforce page

we have a pop-up in live agent console. Basically we have a visualforce page on top of third-party live agent console. it will pop up when a call comes in. In the last couple of weeks, the pop up ...