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

Orderitems Javascript Button replacement for Lightning

Currently I have the following as a javascript list button that allows the user to selected records: {!REQUIRESCRIPT('/soap/ajax/29.0/connection.js')} var selectedRecords = {!GETRECORDIDS( $...
0
votes
1answer
31 views

Visual Force: can you use a javascript function to call a pagereference apex method to do a page redirect

<apex:page controller="test"> <apex:includeScript value="/soap/ajax/40.0/connection.js"/> <script type="text/javascript"> function CheckUI() { loadAndGo(); ...
0
votes
1answer
38 views

How to save HTML code from web page?

I want to send email after showing preview. For preview, I am using slds-modal in lightning component. It's layout is as shown in image. Is it possible to save html code of modal content and send it ...
0
votes
0answers
21 views

Refresh record page from popup

I have a list button which opens a popup. I am performing some operation there and when I click on 'Close' button(command button in my VF page). Then it will close the popup and refresh the detail ...
0
votes
1answer
17 views

Fetching latitude longitude datat from image on IOS in SF1 App

I need to to fetch the Latitude and Longitude of Image captured or uploaded using SF 1 App.I am using EXIF to fetch the same in javascript(helper) While it is working on android , same does not work ...
0
votes
1answer
25 views

getting value from controller to VF page

I have a function inside my apex controller : public List<Decimal> getcheckProductMaxMinPrice(){ List<Decimal> listDeci = new List<Decimal>(); listDeci.add(5.0); ...
0
votes
1answer
49 views

Convert this visuaforce - Javascript to Lighning

I have requirement to transform this code into lightning. I can see that sforce.connection.query is not working in lightning. I am new into lightning development and not sure what is the best approach ...
0
votes
1answer
34 views

replace function in JS controller Lightning

I want to replace the call back response with the component value. var actionAcc = component.get("c.getPickupLineItems"); // alert("pickup response: " +actionAcc); actionAcc.setParams({ ...
3
votes
1answer
48 views

Helper method not calling other helper method

I'm trying to break logic into a few separate chunks, but hitting a snag. The basic structure of my helper looks like: ({ foo: function (component) { console.log(this.bar); // <-- ...
4
votes
2answers
315 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
2answers
68 views

@RemoteAction in Lightning web components [closed]

How i can migrate this code to Lightning web component: <div id="totalAccounts"></div> <script> Visualforce.remoting.Manager.invokeAction( '{...
3
votes
2answers
160 views

Why without the JSON.parse method, I can't sort the data in lightning-datatable?

I'd like to understand the usefulness of the method JSON.parse in the JS file of a lwc when we want to perform certain actions on a list of objects retrieved from our apex controller. I give you an ...
2
votes
2answers
178 views

How to load and use external library?

I don't know how to use the library of Pagination in a lightning web component but I can't use the example method: $('#demo').pagination({ dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 195], ...
1
vote
1answer
36 views

Pagination error

I want to do a paging, but I'm having some problems. When I select the page number in pagination, the "selected" class is applied to the position and not to the number itself. My HTML: <template&...
0
votes
1answer
33 views

Lightning Component - Copy Canvas to Clipboard

I'm trying to copy the image of a canvas to my clipboard in a lightning component using javascript. So far I have this in my helper: copyData: function() { this.canvas = component.find("canvas")....
1
vote
1answer
33 views

Unable to navigate to community page using <lightning:navigation

I am using a <lightning:verticalNavigation> which calls a method to redirect to a Lightning Community page. Component <lightning:navigation aura:id="navService" /> <lightning:...
1
vote
0answers
64 views

SSJS script activity not updating Query Definition as expected

I am trying to update a query definition in Marketing cloud using SSJS script which updates the query based on the datestamp. When I run the script, I don't get any error but it does not seem to be ...
1
vote
0answers
49 views

DOM Exception JSON.stringify - Error in Console

Updates: ----Latest Update---- I am able to convert the event to a string with dojox and their serializer that allows circular objects to be stringified. I originally tried to include dojox via a ...
0
votes
1answer
41 views

Lightning PageReference Object Passing Field Values in standard__object

I am launching a Subtab using the Lightning Workspace API, and using an Aura pageReference object to specify that I want to create a new Task. I want to pre-populate the WhatId on the Task when the ...
0
votes
1answer
31 views

Jsforce where clause having multiple conditions not working

This below code results in INVALID_FIELD: Test' AND ParentId = null AND EndDate > '2019-05-21' LIMIT 1 error.. How can I add more than one condition in where clasue? const a = 2019-01-03 const b = ...
0
votes
0answers
21 views

Create a button that works everywhere in lightning [duplicate]

Hey so basically i want to create a button that i can use anywhere to open a link to URL in UAT. The create custom buttons in or quick actions in sandbox are kind of restricted like i can use the ...
1
vote
1answer
51 views

.set and .setCustomValidity not working for two checkboxes

I am trying to place a custom validation if atleast one of my checkboxes is selected or not. and show the relevant error message. I am able to achieve this when there is only one checkbox , HOWEVER ...
0
votes
1answer
84 views

How to access client side javascript variable in SSJS?

I am facing difficulties in showing a message. Below is the problem statement : I have six textboxes on a cloud page which stores six digit coupon code(one digit each). I am trying to show a error ...
0
votes
0answers
35 views

sforce is not defined in UAT, but in sandbox yes

I'm having this problem, and I've tried all the solutions that can be found in this world to resolve; I'm working with the opencti APIs, in an aura component, in the sandbox the component runs fine (...
0
votes
0answers
29 views

How to Pass record id from community page to another?

I am using navigation mixin for navigating to a community page from other community page- this[NavigationMixin.Navigate]({ type: 'standard__namedPage', attributes: { ...
1
vote
0answers
14 views

Capture Browser Click Events from Console Component

I am trying to capture all clicks in the salesforce classic console from a script in a custom console component. The following javascript logs all onclick events in the console in the frame of that ...
0
votes
1answer
18 views

I have an error while moving to 'Setup' screen from 'Home' page in SF sandbox

while moving from Home to Setup page, navigating from button at right upper corner in sales-cloud enterprise edition. I am facing this from last 1 hour.
3
votes
1answer
113 views

How to display lable to a url cell in LWC datatable?

I am trying to build a datatable in lwc and one of the column's datatype is url. When I provide URL it shows as https://www.google.com , what I want is just label "Google.com". I can see from the ...
0
votes
1answer
40 views

Use of Map (Collection) in Lightning Component JS

I'm preparing a Map and doing some operations var tempParentMap = new Map(); tempParentMap[key] = someList; This code works when I iterate through forEach loop Like: Object.keys(tempParentMap)....
0
votes
0answers
18 views

Jquery inside apexpageblocktable

I am having a pageblock table with three picklists. based on one picklist value and text the second picklist would generate the values and based on selected second picklist value and text the third ...
0
votes
2answers
66 views

Set picklist field on object using Lightning Data Service

I have a field, Region__c, on my Case object that is a picklist. I am trying to set this field in JS using Lightning Data Service. When using component, set it doesn't seem to be sticking. Any ideas ...
0
votes
1answer
26 views

campinglistformcontroller.js can't insert form in database trailhead

I'm stuck at the last component Aura challenge, I managed the challenge but when I try to insert a form in the database it makes me mistakes. I tested with two submitform function ...
0
votes
0answers
20 views

How to enable right click open new tab option along with the feature of left click that opens in same tab in visual force page

We have a custome emails section where we can open the email message if we click on the email subject. Below VF code we are using to achieve this. <apex:column headerValue="Subject"> <a ...
0
votes
1answer
31 views

how to limit the data to be displayed from the long text area field in the visual force page?

We have developed a custome emails section through custom vf page. Need to display the sub string of text body from the email message object. Below is the custome email section we have developed : ...
0
votes
0answers
31 views

VF phone number display format

I would like to do one input text of phone number with bottom border only and the phone is separated into two parts: area code + number on the next format : XXX-XXXXXXX Within one input. It's mean ...
0
votes
1answer
71 views

Is it possible to call an intranet or local server using a lightning component?

For example, if a local server outputs a JSON with sensitive information, and I can access it through my local network, can I access this data using a lightning component?
1
vote
2answers
68 views

How to add an onchange event to a <input type=“file”

I am unable to get a <lightning:fileUpload> to work on a public community page, so I need to write a custom upload component. I want to fire an onchange event after the user selects a file ...
1
vote
0answers
26 views

Multiple filters for same field in wave:update

I'm developing a Salesforce Aura component that updates an existing Wave Analytics dashboard whenever something changes within the component. Those changes may affect same field with several values ...
0
votes
1answer
26 views

How do I create a single Instance of an object and upload multiple attachments for that object in lightning?

When I'm uploading an attachment every time, on Clicking of the Save button which calls the function using javascript in Lightning Component, it creates an Instance of an Object whose ParentId I'm ...
0
votes
2answers
33 views

Lightning Component Display Integer from Apex Class

I have created an Apex class which takes the opportunity Id and finds me the days between two today and future date, what i'm now struggling to do is display this within my lightning aura component. ...
0
votes
1answer
29 views

Complete component reload

I need one of my own component to completely reload itself when a given event occurs. By this, I mean I need it to load itself as if the page it is contained in was loaded the first time ; this, ...
0
votes
1answer
62 views

how to display first letter of first and last name of profile user within a icon | Lightning Component [closed]

For eg:- my name is hitesh rayal and want to display it in the same way as they have done in the below screenshot get profile user first letter of first name and last name and display it in a icon ...
1
vote
1answer
49 views

How to get reference to Component from inside an event method

I have a JavaScript helper method which handles a message sent from a child iframe handleMessage: function (event) { console.log('handleMessage'); console.log(JSON.parse(JSON.stringify(event....
-2
votes
1answer
37 views

Regex validation for us phone

when I am using lighting input and using pattern its works <aura:application extends="force:slds" > <aura:attribute type="string" name="phone" /> <lightning:input type="phone" ...
1
vote
1answer
48 views

How to toggle classes off one element and on another after onclick

I am creating a custom menu using the Salesforce Lightning Design System Global Navigation with sub tabs <div class="slds-context-bar slds-context-bar_tabs"> <div class="slds-context-...
1
vote
1answer
36 views

How to select all child checkboxes using HTML5 data attributes in Lighting

I have some code in my Lightning app which displays regions and countries beneath them using the code below (sorry its a bit messy I know): <div class="slds-checkbox"> <input ...
1
vote
1answer
33 views

How do I get the value from an attribute after onclick event?

I have an a tag with an onclick event: <a href="javascript:void(0);" onclick="{!c.handleClick}" data="{!a.Id}" And a JavaScript controller method to handle it: handleClick: function (cmp, event,...
1
vote
1answer
30 views

Is it possible to instantiate a javascript static resource?

I have a static resource to reuse javascript between my lightning components. I'd like the code to use specific credentials for an api in a sandbox, and another in production. I plan to use an apex ...
1
vote
0answers
88 views

SSJS - Read a Data Extension after an Rows.Update

i'm now in my firsts baby steps in JavaScript on Salesforce Marketing Cloud. In my script i read one Data Extension with an DataExtension.Init("DE") and a DE.Rows.Retrieve(filter). After this, some ...
1
vote
0answers
26 views

Apex param or Action Function doesn't work

I would like to get param in Visualforce page. But, I can't get. 1.User input text, and click button in Visualforce page.  User add rows to input text.(I used javascript) 2.In next page, we want to ...