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
0answers
17 views

What does ACTION_ENDPOINT_CONTENT do?

I can't find these in any of the docs: ACTION_ENDPOINT_CONTENT and ACTION_ENDPOINT_GRID But it's being used often in the code such as below: 'use strict'; var PagingModel = require('dw/web/...
1
vote
1answer
126 views

Javascript not calling apex function

I have an actionfunction called 'afterValidation' defined; <apex:actionFunction name="afterValidation" action="{!prohibitedCountryCheck}" /> I am calling this function on 'Next' button; <...
2
votes
2answers
326 views

Web-to-lead form dynamic return URL javascript

I have a web to lead salesforce form, and I want to have a dynamic thank you page link based on the answers I get in the form. I was trying to do it like so by setting the retUrl var in the ...
6
votes
4answers
16k views

How can I quickly get today's date in a Lightning Component? (for use in an attribute)

In Visualforce, we could merge {!TODAY()} directly in the markup. What is the equivalent in a Lightning Component?
0
votes
1answer
54 views

Checkbox is always unchecked in LWC

I have below HTML code where I click on the header check box and it should check all the check box rows <thead> <tr class="slds-line-height_reset"> <th> ...
0
votes
0answers
38 views

Pass JSON String in Visualforce component

I need to pass a JSON string in my Visualforce component : {'BillingCity':'Dubai'} <apex:page showHeader="false" sidebar="false" standardController="Account" recordSetVar="accounts"> <c:...
1
vote
0answers
888 views

Re-render jQuerys FullCalendar?

I'm using FullCalendar on a Custom Object that shows each record in a calendar and I'm not entirely sure how I can make the calendar re-render depending on the ID I'm passing it. If I select a ...
0
votes
1answer
401 views

Javascript in place of apex:page action - JS remoting

I want to know if I can use javascript in place of apex:page action. I am implementing js remoting in my vf page. I am going to add @remoteaction before my pagereference method in controller. I also ...
1
vote
0answers
156 views

How to fetch input field value in JS in LWC [closed]

in the below html code I am iterating 2 lists linItemData(11 records) and studyData(20 records) <table class="slds-table slds-table_cell-buffer slds-table_bordered"> <thead> ...
0
votes
2answers
823 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 ...
1
vote
2answers
3k views

Customised confirmation dialog in a Lightning component

Hi I want to show a confirm dialog as shown can the do the same using Lightning CSS. I know we can use onclick="return confirm('test');" but look and feel of the same is different. How should I ...
0
votes
1answer
439 views

Custom Button JavaScript to select a check box error

I am currently working on a button on the lead object to automatically select a check box field on the lead object when pushed. The field is called "advocate_record_created__C". When trying to execute ...
0
votes
1answer
20 views

Object Property Visible But Undefined

In an aura component, I'm passing a list of records of a custom object from the server to a helper function. Now as a JS array of objects, I attempt to add a new property to each object and assign ...
0
votes
0answers
59 views

Uncaught TypeError: 'set' on proxy: trap returned falsish for property 'percentage'

I am trying add a value to a property in js in lwc On click of apply button I need to fetch the data from all the input field iterated below as per the size of lineItemData array but when I hit apply ...
0
votes
1answer
69 views

How to use input field value in LWC

I have below table in lwc, size of the lineItem list is 11 records and accordingly it created 11 input fields now whenever I add anything on one column it shows on all 11 but the the requirement is ...
0
votes
0answers
69 views

Using RxJs with LWC in Salesforce

I want to use RxJs in my LWC. I was successfully able to import RxJs version 5. However, how can I use it with LoadScript. This is my code, it is giving me the following error "of is not a function at ...
0
votes
1answer
44 views

Wired Apex for LWC

I am hoping a better JS developer can explain to me why one of these methods fails and the other works. I have some wired Apex to get data into an LWC. If I used a tracked property and 'this....
2
votes
2answers
76 views

How to create a reusable picklist component

I have created a lightning web component which is a pick-list. My intention is to pass objectApiName and fieldApiName as parameters and then render UI accordingly. So that I can reuse this component ...
3
votes
2answers
381 views

Component.set is slow with a large array of objects

I am developing a lightning component. In this component there is an attribute called allItems that contains an array of objects. Currently tested holding up to 600 objects. However when I call a ...
1
vote
1answer
29 views

How to edit cell value of lightning data table programtically

I have a lightning data table with a inline editable field. It working perfect as expected when I do manual edit and save. What I need in addition to the existing behaviour is, I need to edit the ...
3
votes
1answer
138 views

Equivalent of !$A.util.isEmpty() in LWC

I have been using !$A.util.isEmpty(var) to check if value in empty/null/undefined in aura but this is not supported in LWC. What will be equivalent of this expression in LWC. I don't want to write ...
2
votes
1answer
420 views

JavaScript Error when typing in lookup field

I am receiving this javascript error in an up-to-date version of Google Chrome (Version 45.0.2454.101 m): error: {faultcode:'soapenv:Client', faultstring:'Attribute "xmlns" bound to ...
0
votes
1answer
30 views

ParseJSON Error for HTTPPost - SSJS Unable to retrieve security descriptor

In my marketing cloud, landing page. Getting the error "System.InvalidOperationException: Unable to retrieve security descriptor for this frame" while trying to Parse the JSON response in a HTTP Post ...
0
votes
0answers
21 views

Quick Action with Lightning Component appears in the Feeds

I am trying to reproduce the button we have in the SF Classic in to Lightning. The button (Pass to Customer Service) assigns the cases to the Owner (Customer Services whose id is(eg: ...
0
votes
1answer
26 views

Convert custom button in to Lightning component

We have a Custom Javascript button on the case object which looks like below {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} var caseObj = new sforce.SObject("Case"); caseObj.Id = '{!Case....
3
votes
1answer
97 views

Normalizing Boolean values in LWC

Looking at LWC e-bikes sample gallery, I found these comments in code regaring normalizing values. Can someone refer to what they have meant or how to do this normalization using best practices? ...
1
vote
1answer
701 views

Pass an Array variable between javascript and apex

I have a little problem but I'm not able to find a solution.I'm trying to pass an array variable "d" from javascript to List variable "values" in the apex controller. Here my code: javascript: ...
0
votes
1answer
416 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 ...
2
votes
1answer
97 views

Way to add Icons/Image in Lightning Combo-box in LWC? [closed]

I want to create UI in LWC, as per images shown below : Those icons have to be dynamic (depending upon certain conditions those will change). I created lightning combo-box, but I am not able to icons ...
0
votes
2answers
50 views

Having trouble getting DateTime Property in LWC [closed]

Trying to do a simple LWC that displays relevant fields at the top of an opportunity. But one of the fields is a DateTime field and is giving me some significant problems. When I check in the console, ...
1
vote
2answers
441 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
2answers
483 views

Contact Role in JavaScript Button

I have a JavaScript button that's designed to pull in a value from a custom lookup field to a Contact record from an Opportunity record. Does anyone know how I can modify this button to pull that ...
1
vote
1answer
464 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 ...
10
votes
2answers
1k views

Use of ES6 Default Function Parameter Value Spec in Lightning Components

Whilst doing some cleanup of some Lightning Components for Summer 16, I was creating a JS function in my helper. I had wanted to add some default values to that function using the new ES6 Default ...
1
vote
0answers
14 views

Question on URLFOR SPACE

I am using a URLFOR function in the URL field. When i am entering 'X Y' for the query string parameter, the output of the URL is https://www.google.com?X+Y=777 instead of https://www.google.com?X%20Y=...
1
vote
1answer
72 views

LWC Modal Losing Focus

Update 10/25 I have a modal that I am creating when a user clicks on a lighting card. For accessibility reason I need the focus to remain in the modal until the user clicks Dismiss or hits the ...
0
votes
1answer
33 views

Is it possible to load KendoGrid in a Ligthning Web Component?

I am trying to use Kendo Grid in Lightning. I was running into similar issues as this thread Error while loading a js as static resource in lightning Web component. I was able to get a little ...
14
votes
4answers
2k views

Lightning Framework vs Standard Client Side Frameworks (i.e. React) // Which to chose when, and why?

Disclaimer Keep it objective! This one can get a little opinionated, please try to keep your answer specific to the facts a developer should be considering when choosing between two viable options ...
2
votes
1answer
149 views

(LWC) - Lightning Datatable: Custom Data Types

Is it possible to create lookup fields and picklists with custom data types now? Documentation says: Create your own data types if you want to implement a custom cell, such as a delete row button ...
0
votes
1answer
621 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 ...
4
votes
1answer
131 views

Mocking CurrentPageReference wire in Jest unit tests - LWC

I have a LWC component which uses CurrentPageReference from lightning/navigation bundle in a @wire function. I am using lwc-jest to create unit tests for my components. Using the wire with ...
0
votes
0answers
32 views

Why .addEventListener(“click” doesnt work on mobile but works on computer?

I have an LWC that works perfect in computers but doesnt work on mobile Devices marker.addEventListener("click", function(e){ // Centra la pantalla al marker seleccionado ...
1
vote
1answer
543 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 ...
3
votes
1answer
466 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? {!...
1
vote
0answers
41 views

Modal being rendered in wrong position on lightning web component's mobile page

What I want I'm trying to show a modal to warn the user when the service he is trying to reach is offline. This salesforce page is accessed by Salesforce1 through a tablet. How I did I've created a ...
1
vote
1answer
39 views

RequestAnimationFrame in LWC

I'm implementing a pretty straight-forward animation in LWC (Lightning Web Components). My normal approach to doing animations within JS is to use requestAnimationFrame, but the linter rules in LWC ...
0
votes
2answers
473 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 ...
2
votes
1answer
62 views

Apex called from Aura omits null elements from response

It seems like collection types returned from the Apex to an Aura component omit null elements. I noticed this when I was passing a List of Strings back from Apex. I was failing to get the second ...
0
votes
1answer
103 views

Apex - Check if user has permission to edit Field

Is there a way to check via Apex or Javascript (Lightning Component JS Controller) if current user has permission (profile or Permission set) to Edit fields on Account Object ? For example, i have a ...
0
votes
1answer
88 views

Problem in Imperative way of calling apex through LWC

I am new to Lightning Web Components. I created a component that searches for accounts. I used imperative method to call apex. I am having trouble understanding what is happening during imperative ...