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
3answers
377 views

How can I change standard fields using jQuery in an embedded VF page?

I'm trying to have some code run when the Billing Address field (or sub-fields) of an Account is changed. This code will clean up the address, and then I want it to replace the contents of the Billing ...
1
vote
2answers
419 views

How to use the child objects in a related list after a soql call in Visual Force

My org has an account object with a related list of Contacts. I am querying for the Contacts from the Account and want to use the data on the Contact object. How can I access fields from the contact ...
1
vote
0answers
171 views

ETPush.registerForNotifications() method in JB4A SDK Cordova Plugin, callback not working

I've created a Github issue for this as well, find it here: https://github.com/ExactTarget/JB4A-SDK-CordovaPlugin/issues/3. The Github issue has images and code to review. For a quick summary, the ...
1
vote
0answers
360 views

Visualforce and Console Integration Toolkit results in Cross-Origin Framing error

I'm working on an App-level console component that has links in it. Those links should open new tabs (preferably in the console layout, but a new browser tab works as well) not on the Salesforce ...
13
votes
5answers
7k views

How do I set the id of an apex:pageBlockTable row?

I'd like to be able to assign each row in a table an Id so I can easily find the row(s) later using JavaScript. I see where I can set the id of the table but I'd like to also assign an id to each row ...
9
votes
2answers
978 views

Javascript remoting not hitting apex?

I'm trying to call an Apex function from a Visualforce page, but my Apex function isn't getting hit. What am I doing wrong? I have this ct_4_sf.RecordingTest.saveRecording( paths, function(...
3
votes
1answer
336 views

page navigation

i have a visualforce page where most of front end code is in HTML / CSS / JS. We are calling controller methods using javascript remoting. Is there any option other than window.open('new_page','...
0
votes
1answer
268 views

Update newly created record's lookup field, using Id from just created lookup relationship

I need to create a new Case, populate the Case's lookup Project__c field with the Id of the Project which the Case has been created from, then populate the Program__c lookup field with the Id of the ...
2
votes
1answer
873 views

Hiding Rows pageblocktable

I have a page on which I'm adding rows to pageblocktable but not saving them. <apex:commandButton value="addrows" action="{!add}"/> <apex:pageBlockTable var="a" value="{!statuslist}" > &...
3
votes
1answer
271 views

sforce.one.navigateToRelatedList Is not working

I am new in salesforce and I'm trying to make a call from a visualforce page inside salesforce1 (now called lightning, I think) to a Related List of contacts. My page show some options related to the ...
1
vote
3answers
771 views

Change focus away from date field in visual force page

I've tried using other code suggestions to change the focus to another field: document.getElementById('{!$Component.fOpportunity}').focus(); and changing the focus on load: <script>function ...
9
votes
2answers
5k views

How to calculate the row values in apex:repeat

I have a VF Page which displays the values from different object as a table. I need to perform the row based calculation in that table. Please find below the example and help me out in solving this. ...
2
votes
1answer
11k views

Query on permission sets held by a user

Does anyone know a basic way that I can run a SOQL query to see which permission sets are attached to users? We have a rather large issue where a button needs to be on a page layout for a few ...
4
votes
1answer
484 views

Lightning Dynamic Controller

Finishing a drag and drop feature with a list but I came across a difficulty : Is it possible to add a controller action to a DOM element added dynamically ? Let's say I have a userController.js, in ...
3
votes
1answer
228 views

Mass update child records using apex class visualforce page with javascript

I'm having a problem in using javasacript to display an error while mass updating a child record of an opporunity once I found the picklist ed_sp_ls__c='return' and the value ed_vpo_n__c=0 of at least ...
7
votes
2answers
4k views

Return Boolean From Action Function called from JS

I have a page which displays a bunch of input fields for a record (fairly standard) and allows the user to update those fields and then save the record. On the bottom of the page there is a command ...
3
votes
2answers
961 views

Javascript custom button throwing error - Undefined is not a function

I believe this is more due to my lack of knowledge about Javascript. But since i am working on salesforce, i thought i would post the question in this forum. There is a label SS_TLIfieldIDs, whose ...
5
votes
1answer
2k views

jQuery won't execute, even with .noConflict();

I've googled this extensively and still can't debug the issue - I'm setting var $j = jQuery.noConflict();, I've verified that the js and css files are loading properly on the page. Can anyone see what ...
1
vote
0answers
445 views

Google Timeline Rerender problem

I'm trying to include Almende's Google Timelines (Link to documentation) and I'm having some trouble rendering the timeline after the first time. I'm using JSON to fill in the data which is computed ...
1
vote
1answer
4k views

Fetch Values From Related Object Fields - JavaScript

I need to assign an Entitlement to all Cases created from an Opportunity, when a user clicks a custom button. I've created a custom field on the Account which contains the Entitlement Id ...
4
votes
1answer
174 views

Custom Email button works for me but not my users

Afternoon all, I have a custom button on my Opportunity object to Onclick Execute Javascript to send an email to a specific email address, code below: {!REQUIRESCRIPT("/soap/ajax/27.0/connection.js")...
1
vote
0answers
248 views

Debugging VisualForce Pages in Google chrome

Sometimes I need to debug my visualforce pages for console application and this is what happens. When I step through the javascript during debugging, For any of the calls encoutered for sforce....
0
votes
1answer
841 views

Pass currency value to custom field using JavaScript button

I need to populate a currency custom field Value_Of_WE_Spend__c on a custom object WE_FEP__c with the value from an opportunity currency custom field Annual_Settlement_Value__c. I've written the ...
2
votes
2answers
581 views

Bootstrap 3 VF javascript not working

I am trying to implement the bootstrap accordion feature: http://getbootstrap.com/javascript/#collapse-example-accordion So I upload the static resource and included in my VF tag But when I render ...
0
votes
1answer
171 views

Is it possible to get personalization strings when pulling content from DE with Server-side JavaScript in emails?

I'm trying to use server-side JS to dynamically write variables based on the column headers of a data extension for an email. Then fill those variables with the row contents of those field headers. I ...
1
vote
0answers
175 views

Console JavaScript button behavior inconsistent on same Contact recordtype

In order to use the Service Console to display relevant details from Account/Contact/Asset while a Case is being created, I have a button on the Contact record that creates a 'shell' Case, saves it, ...
1
vote
1answer
597 views

Access controller property with Javascript visually immediately - after page load but before user action

I want to be able to access a controller property with Javascript to do some styling (based on the value of this property) so that it appears visually to be executed immediately on page load. However, ...
0
votes
1answer
10k views

Open a new window on click and new tab on right click of a home page layout link

Open a new window on click and new tab on right click of a home page layout link. I managed to open a new window with following syntax. window.open(url, mywindowName, height="200", width="400"); ...
2
votes
2answers
2k views

Trying to get lookup field value in JavaScript

I have a custom object named CPQ_Request_for_Proposal__c, which has a lookup(Text) value for Account__c. I'm trying to code a button which will use the value of Account__c to get actual Account ...
1
vote
1answer
427 views

OnClick JavaScript id issue

I am using a List custom button in Listview once I select the records through checkboxes then the script will call and get the list of id's and pass them to apex class methods, but at that point I am ...
0
votes
1answer
2k views

Check the current field value before updating in custom button

I am creating a custom button that will update the Status field on the Case object to "Resolved". Before the field is updated, I would like to first check if the field already is set to "Resolved". ...
5
votes
1answer
220 views

Why does a lookup to custom object on sites give invalid ID?

I am developing an internal site for all company employees (basically an intranet). I am using a visualforce page but it must be externally available because not all company employees have a ...
3
votes
1answer
398 views

Odd JS Remoting Behavior

I am in the process of porting an AngularJS application to Visualforce and Apex. For some of my services, I am using a custom controller with remote actions. Since this app will be included in a ...
2
votes
0answers
571 views

Javascript SOAP API external access

I am trying to call our Salesforce SOAP API from an external server using JavaScript, but I am getting an error because the URL it is using is from my localhost server. I am getting this error: ...
3
votes
0answers
606 views

Visualforce Charting rendererFn with Chart label [duplicate]

I am using rendererFn for chartTips "<apex:chartTips height="40" width="120" rendererFn="renderChartTip"/>" and it changes the label for hover over the bar chart. We need the same behavior for ...
2
votes
1answer
20k views

How to create Map<String,List<String>> in Javascript?

How to create Map<String,List<String>> in Javascript? Push method does not seem to work if we define aMap = {} and if(aMap [key]) { aMap[key]....
0
votes
1answer
400 views

Javascript HashMap to Visualforce Remoting Method

Can we pass HashMap from Javascript to controller? Where aMap['a123']=['xy','yz']; and aMap['b456']=['ab','bc']; I want a remote action method with Map> parameter in controller.
2
votes
1answer
14k views

javascript error in if condition. “Unexpected token &&”

In a javascript i am storing an array of values. My question I want to compare each and every index value. When I am using && I am getting error saying var result =<value>; if(...
3
votes
1answer
2k views

Date of Birth Field in Salesforce

Exposed Date of Birth Field on Visualforce page. This is of Date type Its shows Historical dates only, can i have dating back to at least 1900.
5
votes
1answer
4k views

VF Page: Best way to avoid datepicker focus on load?

I have two date fields on my Visualforce page and on occasions the datepicker/calendar pops up upon page load. I understand one way to prevent this is to use javascript as suggested below: <input ...
1
vote
2answers
2k views

Custom button javascript error on Unexpected token ILLEGAL

I have a custom button where I want to check for conformation. I wrote my javascript for conformation but I am getting error that A problem with the OnClick JavaScript for this button or link was ...
1
vote
1answer
338 views

Access API/Sobject name from List Button

I have a visualforce page that will be accessed via a List Button. This VF page relates to the case object and the list button will appear on several object UIs (opportunity, account etc) related ...
2
votes
2answers
3k views

Window.Close browsers issues

I have a standard Lead page that opens a popup window when a list button is clicked. When the popup is closed, I need the parent window to be refreshed. My js code: if(...){... } else{ ...
1
vote
1answer
269 views

Convert record name from lookup field to string field value in JavaScript

I'd like to use the name of the opportunity, which a case is being created from, as the case Subject, for easy reference. My cases are being created using a custom button & JavaScript. I can't ...
1
vote
1answer
1k views

Create new case, assign record type, add to queue & populate other case fields

I need to create a New case custom button which will be displayed on the Opportunities object and selects the record type, while also populating other fields on the case page layout. The easiest way ...
8
votes
3answers
5k views

How to open a URL in a new tab in Salesforce1

I am currently facing an issue in opening an url in a new tab on Salesforce 1 (Mobile) platform. The sforce.one.navigateTo() method does not have any option to open url in a new tab. Any suggestions ...
0
votes
2answers
268 views

validations for a table of Input Fields

I have a series of Input Fields(Name,Quantity,Price) in table format in Visualforce page. By below JS i can validate if fields doesn't have any text by using their 'StyleClass(requires)': function ...
0
votes
1answer
48 views

Remembering the state of Visual Force page

I have a requirement where I need to remember the state of Visual page. This is required for example in case of governor limit. Can we do this with static JS or is there any JS API available?
2
votes
1answer
2k views

Why is my lightning js function freezing at the event.setparams?

I am trying to get this demo working in my org: http://www.johnbrunswick.com/2015/01/salesforce-lightning-example-ideas-experiment/ My component has an onclick that is supposed to display a modal ...

1
69 70
71
72 73
86