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.

1,006 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
2answers
777 views

Print only a single tab on a tabbed VF page

I have created four apex tabs in a vf page. In that page,I'm using print functionality for the particular div section.Its works fine when i click the print button for the first time.But when i click ...
2
votes
0answers
1k views

Print Functionality in Salesforce1 Mobile App

I am trying to do the print option in the Salesforce1 Mobile app. I have tried two methods of printing, one is a Javascript method and the other I've tried using is the canvas method. But both methods ...
2
votes
1answer
269 views

qtip content filtered with a condition

This is my Code: $(document).ready(function() { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); $('#calendarx').fullCalendar({ ...
2
votes
0answers
630 views

Apex:ActionFunction and getContent

I have a two pages that share the same controller extension. The first page gathers some information for a record, builds a PDF from the second page and attaches it to the case. I have a lot of ...
2
votes
0answers
736 views

Issues for Signature pad in popup Window

I have created a VF Tab in this tab have a custom button "Sign", when i click on the button it will show popup window and I get the signature from customer and save it as an attachment in Account.When ...
2
votes
0answers
318 views

Get Current User Contacts via Ajax Request

Is there a way of fetch a current user's contact information from a canvas app via an ajax (javascript) request? Thanks.
2
votes
0answers
274 views

Fetch more and append records using Data Repeater and pagination Site.com

I want to fetch more records and display the previous records along with newly fetched records using pagination. But the default behavior of pagination is to override previous with new one. Is there ...
2
votes
0answers
269 views

Winter 14 causing errors?

I have a very simple VF Page, that just has an action method that copies the address of the head of household to all the rest of the contacts to the household. This has worked fine, but on Saturday ...
2
votes
0answers
459 views

error message on page close

I have a Visualforce Page that will show an error message if a user tries to exit page without hitting one of the command buttons. It shouldn't trigger if the user clicks on the command buttons. This ...
2
votes
0answers
34 views

Anyway to hack subscriber users to a piece of content?

Is there any supported or unsupported way to programmatically subscribe a user to a piece of content? A related post suggests that you might be able to hack a post to make a piece of content as ...
2
votes
4answers
2k views

Clicking button should reload the page and the callout must be performed asynchronously

My question is, should clicking a button reload a page and perform an asynchronous callout? It looks like its reloading the page after finishing the callout. Custom Button : Execute JavaScript {!...
2
votes
1answer
648 views

JavaScript to determine Salesforce1 location (native app or mobile browser)

I've found that I need some different behaviors based on whether the user is visiting my VisualForce page via the Salesforce1 native app (iOS or Android) or is using a mobile browser on the /one/one....
1
vote
0answers
19 views

Failed to execute 'add' on 'HTMLSelectElement': The provided value is not of type '(HTMLOptionElement or HTMLOptGroupElement)'

There is library written in vanilla js for datatable Vanilla-Datatables, I am trying to use that library to create datatables. HTML: <template> <div class="container-fluid"> ...
1
vote
1answer
62 views

Dynaically add and remove Row in LWC

I have a custom LWC page which has date with Input Field and dynamically add and delete Button. Like Below May 04th Input box type=number add Button Delete button May 05th Input box type=...
1
vote
1answer
30 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" ...
1
vote
1answer
44 views

<lightning-input-field> not rendering when wrapped in child component

So I am trying to dynamically render out the fields of a Salesforce account, since this is supposed to be a package and I do not know what fields and rules the organization has on an account. However, ...
1
vote
0answers
41 views

Integrating external application into SalesForce frontend

I would like to create a component that will integrate an external javascript application into SalesForce. This means, that the application will start and run in the SalesForce. This application needs ...
1
vote
0answers
24 views

Can't connect lightning aura component with Google tag manager

I have a lightning component which I'm trying to connect with Tag Manager. I followed the instructions in the tag manager page, first saved the js code as a static resource then called that script ...
1
vote
2answers
41 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 : ...
1
vote
1answer
55 views

How to iterate the value in component.find lightning?

In my parent controller i have the following code. var name = component.find("towermid"); console.log("name"+name); //component.set("v.isReadOnly","true"); This console name returns: name:...
1
vote
1answer
51 views

refreshApex not always working

I have a parent LWC with a list of records and a child LWC which allows the user to perform actions on the record. The child uses dispatchEvent and CustomEvent to notify the parent after changes have ...
1
vote
2answers
56 views

LWC - Updating date field

Trying to update the following fields,Date field is not updating in updateRecord.( Other Fields got updated with correct value). When i console.log the new Date() it print as below. Sat Apr 04 2020 ...
1
vote
0answers
23 views

How to update object value on the cmp file from the Javascript file?

<aura:attribute name="updatePaanV" type="Paan_List__c" default="{ sobjectName : 'Paan_List__c', Name: '', Paan_Color__c:'', Paan_Description__c: '', ...
1
vote
0answers
72 views

Google Analytics Event Tracking in Community using LWC

I'd like to use Google Analytics Event Tracking inside a Community in LWC We have Google Analytics configured in Builder > Settings > Advanced > Google Analytics The documentation says to ...
1
vote
1answer
224 views

JavaScript Error: Uncaught (in promise) undefined - when using FullCalendar 4.4.0 in LWC component

I am trying to use FullCalendar 4.4.0 Timeline View inside a LWC component. html <template> <section class="slds-card slds-p-around_medium"> <div class="calendar" lwc:dom="...
1
vote
0answers
32 views

OpenCTI searchAndScreenPop method

How can I use the searchAndScreenPop method (Lightning) to search by a custom field? For example : I'm trying to use this method to popup a Lead which has the phone number as a param, but I don't ...
1
vote
0answers
206 views

LWC Template saying object array undefined

I am trying to produce a LWC that displays a custom data that I get through a series of steps, but is saying that the objects in the array are undefined and I cannot pass them into the template. ...
1
vote
0answers
34 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 ...
1
vote
0answers
243 views

Dynamically assign sObject field details in LWC

I have created a inline editable LWC. This solution is dynamic i.e. to add a new field on the table , i just have to add on field set and based upon field type and access, it will be displayed in the ...
1
vote
0answers
28 views

window onclick listener not working properly

I have created a custom lightning web component that, if an specific div is found on the template and you're clicking outside of it, it must close the current div constructor(){ super(); ...
1
vote
0answers
67 views

accessing proxy inside a proxy object in LWC

in the picture are two responses when i query the task object. My use case is that I have to iterate over the response using For:Each, For:Item and render a list in the .html file of {Task.Id}, {Task....
1
vote
0answers
61 views

Open a Base64 PDF from Lightning Component JavaScript in new Tab

I am trying to open a PDF that I am getting from a response from a microservice. I am able to receive the PDF and set the parameters for it within the lightning component helper, and download it. ...
1
vote
1answer
116 views

Display javascript variable in visualforce

I can't figure out how to display the "total" javascript variable in the apex:facet section of the Visualforce page. I keep getting "Cannot set property 'innerHTML' of null" as the javascript error. &...
1
vote
1answer
326 views

Open LWC Component upon clicking Bar Chart data-point

My requirement is to open different LWC Component upon clicking different Bar Chart data-point. I am using ChartJS library to achieve this. Here is the code I have tried to implement --- I am using ...
1
vote
0answers
89 views

ActionHub (Mass Edit + Mass Update + Mass Delete) Lightning Customization?

We are currently migrating from Classic to Lightning. Our ActionHub Mass Edit + Mass Update + Mass Delete AppExchange package customizations rely on copy/paste of JavaScript for unincluded default ...
1
vote
0answers
38 views

Visualforce <Apex:tabpanel> breaks MathJax (math formating script)

Problem: I am using mathjax to format math equations nicely on a visualforce page. Everything goes great on a naked vf page. <apex:page > <!--script id="MathJax-script" src="https://cdn....
1
vote
1answer
36 views

Component event not being caught

It looks like the event is firing but the handler is not catching it. How do I go about getting this component event to be handled? EVENT: <aura:event type="COMPONENT" ></aura:event> ...
1
vote
0answers
15 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
326 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 ...
1
vote
1answer
248 views

LWC - Object OpportunityLineItemSchedule is not supported in UI API

I've created a button on opportunity page using LWC. Once the button is clicked it should create OpportunityLineItemSchedule records based on Opportunity and related OpportunityLineItem record. ...
1
vote
0answers
172 views

force:recordData simpleRecord returning null

Component <aura:component implements="force:lightningQuickActionWithoutHeader,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > <aura:...
1
vote
1answer
54 views

4 Level Picklist Dependency

I'm trying to set up 4 picklist that are dependent on each other. The idea is this: There are 4 different picklist. Pick1, Pick2, Pick3, Pick4 Pick2 is dependent on Pick1. Pick3 isn't necessarily ...
1
vote
1answer
73 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
0answers
141 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'...
1
vote
1answer
60 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
0answers
23 views

Customise Standard lightning Component from custom lightning component

I have a custom feed filter visualforce page created with the help of this link. And then I added the vf page in lightning component with iframe and in case page layout. After the page is loded main-...
1
vote
0answers
99 views

XPath in lightning Javascript

I have an XPATh expression which i want to use in my lightning javascript file. I tried several examples but i have been unlucky. Can someone tell me how do i get a reference of the dom using xpath ...
1
vote
2answers
408 views

Trying to trigger an automation from different Business unit using SSJS Activity

I have written the below code and created one test scheduled automation to start the automation. I didn't get any error when i did scheduled/publish the code but my automation is not starting. and i ...
1
vote
0answers
31 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( $...
1
vote
0answers
159 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 2 3
4
5
21