Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

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
vote
2answers
175 views

Regex on lightning:datatable

I'm using lightning:datatable to display the Account object in a table. I've also added a regex that lets users search for any field in any column. What I wish to do is, if there are no matches, ...
0
votes
1answer
23 views

Dependent Picklist On vf Page

In vf page on form I created a two picklist field: 1st one is date picklist and another one is days picklist. example when we click on days only days value will be displayed like 66 77 88 etc. when ...
1
vote
1answer
28 views

Can we provide notification to users using a pop up when opportunity records gets created from a trigger?

Can we notify users using a pop up window when a opportunity is being created in backend through a trigger ? The popup should appear irrespective of which tab the user is in .
0
votes
1answer
104 views

Salesforce Lightning Event's attribute showing undefined

I am Doing Lightning Super Badge,but stuck atone place. Following is the code snippet. BoatTile.cmp <lightning:button class ="{!v.selected=='true' ? 'tile selected':'tile'}" ...
5
votes
2answers
35 views

Extracting a callback function

I have the following code in my controller: doInit: function(component, event, helper) { // Create the action var action = component.get("c.getExpenses"); // Add callback behavior for ...
1
vote
1answer
394 views

Javascript function evaluates to true even when it returns false in Lightning Helper

I am trying to encapsulate logic to determine if a button is visible inside the second argument via anonymous function: component.set("{!v.assignButtonVisible}", function() { console.log('Do we ...
0
votes
1answer
105 views

Wrong time display in lightning

Hello I have a problem with displaying data into lightning:inputfield Here is my code of setting date to the field: if ((sourceValue == 'Yes') || (sourceValue == 'Ano') ) { ...
0
votes
0answers
13 views

Salesforce1 Navigate to specific Div on different Page in IOS Device

My requirement is to call a visualforce - page2 from page1 and then return back to page1 to specific Div (scroll position) Setting the Div Id to Local storage in Page 1 then accessing it in Page2 ...
0
votes
0answers
74 views

How to pass Date to Datatime lightning inputfield

Hi i have a problem with passing data into the lightning:inputField. Its inputfield of type Datetime and i want to have a function, when somebody pick Yes from picklist, it will automatically populate ...
1
vote
3answers
82 views

How can I move my spinner into a separate Lightning Component?

I have a lightning component which includes a spinner rendered by this code: <aura:component access="global" controller="SomeAuraController" implements="flexipage:availableForRecordHome,...
0
votes
0answers
156 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 ...
0
votes
1answer
160 views

lightning:recordEditForm, mark as missing a field that I'm passing

I have an Issue with this component. When every Try to submit a new OpportunityLineItem The component sends the following error messages. An error occurred while trying to update the record. Please ...
1
vote
0answers
32 views

Voice to Text transfer in apex Visualforce Page

I have a requirement to convert voice to text for searching purpose. I am trying to have this below page in an iframe inside Visualforce page. It is working. Problem is that I need to modify the ...
0
votes
0answers
30 views

How do I modify the $Site.allowStickyUrlParams site setting?

Internally, it appears this setting is used in lightning communities to determine if query params are cached onto an object and re-added during route changes in Spa.js. I'd like to not cache query ...
1
vote
2answers
26 views

Javascript button to set checkbox true if conditions are met

I keep getting 'unexpected token ==' when the button is clicked. I have been through the code and everything looks right to me. Can anyone see why? All field names are correct. {!REQUIRESCRIPT("/soap/...
1
vote
1answer
29 views

Enabling and disabling of a field not working inside javascript

I am trying to enable and disable one picklist field based on another picklist field. Here is the piece of code through which i am trying to achieve that <script> function Compchange(){ ...
0
votes
2answers
205 views

SSJS functions not working for Data Extension objects

I'm trying to retrieve the CustomObjectID of a data extension that already exists, by using the External Key/CustomerKey. That didn't work, so now I'm trying to retrieve any DEs at all, and that's not ...
2
votes
1answer
46 views

Salesforce 1 Navigate to specific Div on different Page in IOS Device

How can I retain the button position of a scroll-able area when pressing back button in Salesforce 1? Let's say I have more content in VF page which has 2 or 3 pages and a button on a 3rd page on ...
1
vote
1answer
29 views

custom button on opportunity - visualforce with javascript

I need help. I have a visualforce page named "Edit Quote". I need a button to open this page on lightning. since javascript is not supported I created a button to open another vf page names “...
2
votes
1answer
66 views

Strange! Two different attributes are not isolated to each other in a Lightning Component

Well, I don't know what going on. I'm setting two different attributes in a Custom Lightning Component on init, one is to iteration on UI side and another one is for just reference and it holds the ...
1
vote
1answer
28 views

Only Start of Confirmed Built String Displays in Confirmation Popup Via Visualforce

With each inputCheckbox on my VF page checked, I'm adding to a string in my controller: public with sharing class ApplicationServerMonitorController { public String contactsAboutToEmail {get;set;...
0
votes
2answers
44 views

Custom Javascript Button

I am trying to create a custom button using Javascript to create a custom object record (Project__c) from another custom object record (Quote__c). The problem is I need to pull the Opportunity ID and ...
0
votes
1answer
58 views

How to add new lead to related list of custom object?

i have overridden new button of lead object. My requirement is to add lead object to the related list of the custom object "journey". I have created a lookup field called Journey id on lead. I have ...
1
vote
0answers
29 views

Unable to get screenshot of Rich Text Area Field which contains images using html2canvas library

Unable to get screenshot of Rich Text Area Field which contains images html2canvas Access to Image at xxx site from origin xxx site has been blocked by CORS policy: No 'Access-Control-Allow-...
0
votes
1answer
47 views

Custom quick action button - can I add onclick / init handler to it?

So, I've got a custom made Quick Action Button that renders some elements whenever the button is clicked. Whenever a user clicks this button, I'll need to fetch some ids related to the record - ...
0
votes
3answers
194 views

What is the best way to include commas(as thousand separator) as we are typing into a lightning input field?

I have a lightning:input field like this <lightning:input aura:id="field1" label="Amount" name="amount" type="number" disabled="{!v.isReadOnlyForm}...
3
votes
1answer
70 views

Is it possible to get ui api Picklist Value Collection response body in ltgn comp js (for pcklst dependencies)

Is it possible to access the picklist value collection response body in a custom component js using a built in component? I need access to the dependent picklist values and their validFor property. I'...
2
votes
0answers
49 views

controller throwing javascript error

I have a very basic controller function which is for some reason throwing a Javascript error. HTML where controller is called: <lightning:button label="Apply" iconName="utility:magicwand" ...
0
votes
0answers
23 views

How to get access to $A methods when running in VisualForce under Lightning

I've been trying to use $A methods in a VisualForce page that runs under Lightning. I am able to use the $Lightning methods (having used the includeLightning tag), but when I try $A methods I get a ...
1
vote
2answers
128 views

Show checkbox while loading component

I have used Check all / Uncheck All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its ...
1
vote
0answers
210 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
2answers
133 views

How to remove leading zeros in a number using ampscript/javascript [closed]

I want to remove leading zeros in a number. For example: Input: 0001023 Output:1023
0
votes
1answer
102 views

Error: Compile Error: A value cannot be stored to Sensitive_Account__c in type Lead at line 12 column 11

I am having difficulty getting this saved so I can test with this tiny code in the sandbox. If I can get the test working I can update the message. I am very very new to this. Apex Class is ...
0
votes
0answers
31 views

Any way to bypass the lookup filter error message on a pre-populated lookup field

I have a List custom button named New Opportunity. Whenever a user creates a new Opportunity from a Contact record, I pre-populate the Primary Contact field in Opportunity with the contact name. I am ...
0
votes
1answer
26 views

SOQL Date Comparison on Javascript Button

I'm doing a Date comparison for NOW() on SOQL for javascript button but getting a MALFORMED QUERY Error: var d = new Date(); alert(d); var relatedrecords = sforce.connection.query("...
-2
votes
3answers
427 views

Pass a JavaScript object to Apex controller in lightning

Is it possible to pass a JavaScript object to Apex controller in lightning? Here is what I tried: @AuraEnabled public static void changeProgram(Object info) { update new ...
0
votes
2answers
28 views

In VisualForce, is there a way via code to determine whether we are in a Production environment?

I'm developing some javascript code that I only want to execute when a Visualforce page is in Production. Is there a simple way to check the running environment via js?
0
votes
2answers
121 views

Lighting:textArea minLength not wokring

Component : <lightning:textarea aura:id="commentId" name="comments" required="true" value="{!v.case.Comments}" placeholder="Enter comments here" ...
0
votes
1answer
58 views

salesforce lightning $A.get(“e.force:createRecord”) return empty

I tried component to open the new contact page. Complete reference code var createAcountContactEvent = $A.get("e.force:createRecord"); createAcountContactEvent.setParams({ "entityApiName": "...
0
votes
2answers
40 views

SOQL Inner Query on Javascript Buttons

I'm trying to query for relatedchild records on Order and throw an alert message on cancel custom button but getting an error of didn't understand relationship. {!REQUIRESCRIPT("/soap/ajax/33.0/...
0
votes
1answer
24 views

Use of " and ' inside classic Javascript buttons

I've been trying to debug this piece of onClick JS in a detail page button, as users where having problems. I saw a few syntax issues (such as no enclosing "" around the merged fields) and I think I'...
2
votes
1answer
284 views

Component set() does not work on lightning:inputField if user changes the field value

I'm finding the component.set method only works on lightning:inputField components when the user has not changed the value in that field. See code example below. Component: <lightning:...
1
vote
0answers
21 views

My req to add all input fields (created by picklist) value on total field by on blur event

Here in my code i am getting first field value only. <apex:page standardController="Entertainment__c" extensions="ScreenDetailController" sidebar="false" showHeader="false" docType="xhtml-1.0-...
-2
votes
3answers
167 views

Lightning component not returning a response

I Have a lightning component from which I pass data to an apex class. I return the object. Why don't I get an update on my object neither a response in my lightning component. Lightning ...
1
vote
1answer
87 views

Show modal on top of Component rather that page

I have a component created : <aura:component description="CaseRelatedArticleComponent_ACE" implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId" ...
0
votes
1answer
163 views

Filter select/picklist values in lightning component - Best practices

Please let me know the best way (good performance/turnaround time) to implement my issue. We have a lightning component on communities which has a list of approx 3000 values. We implemented a search ...
0
votes
1answer
35 views

Not able to print out fields of custom object

In my client side controller, I call a server side action that returns a List of custom objects. Each of those custom objects has multiple fields attached to it. When printing the values in the ...
1
vote
0answers
55 views

Crypto encrypt with external IV

how can I achieve the same result from the bellow JS to apex? I already have tried: blob encryptedData = Crypto.encrypt('AES128', AesKey, AesIv, json); //apex but it says 'Invalid initialization ...
1
vote
2answers
29 views

Creating a Lead from a Button

I'm looking to create a lead from an account using a button. When I go to create this lead, I get the following error. Can anyone tell me what is wrong with my approach/code? {!REQUIRESCRIPT("/soap/...
0
votes
1answer
89 views

Invoke Rest Service from Visualforce page

I have a VF page that tries to invoke REST API from within script. On button click I am getting error: No 'Access-Control-Allow-Origin' header is present on the requested resource. I am specifically ...