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
4
votes
2answers
5k views

JavaScript variables accessed elsewhere

I am attempting to count the total number of checkboxes that have been clicked on my page. I have all of the code to determine what's been clicked using JS. I need to pass this number to a controller ...
1
vote
2answers
356 views

Uncaught ReferenceError : a39Q0000000CvnaIAC is not found - Java script

1). I am not able to understand why is this exception coming in JavaScript. I am doing like below - // Service Side Code Calculator__c Calculator= [Select id, name, (select id, fee_amount__c, ...
2
votes
1answer
2k views

How to get Controller list in page java script

Calculator__c objCalculator = [Select id, name, (select id, fee_amount__c, cost_Amount__c, Type__c, from Non_Labor_Cost_Details__r) From Calculator__c p where id =: PId]; When I try to use this ...
2
votes
4answers
7k views

Unable to hide a component on vf page using JavaScript

I'm trying to hide an inputfield on visualforce page based on some condition. So, i started with below code, but unable to hide the inputfield on page load itself. Both the alert messages displayed ...
0
votes
1answer
972 views

Accessing Sobject using javascript

I want to access a Sobject field using javascript in a visual force page and based on its value perform an action. How can I access a Sobject field using javascript?
0
votes
1answer
792 views

How to pass values from the javascript to <Apex:outputlabel>

Im constructing a visual force page in which im trying to display a message in <apex:outputLabel> thru javascript . How can i pass the value to the output label from javascript ,
2
votes
1answer
6k views

System.StringException: Invalid id: null

Im trying to this example program,i seen this program in stack exchange.The issues are connect one VF page 1 to VF page 2 and click save button in VF page 2,it must populate account name in VF page 1 (...
1
vote
1answer
452 views

Pass value from Previous page to first page using javascript

I have two VF page and two apex class,i want to pass value from VF page 2 (textbox1) to Vf page 1(account lookup textbox1) using javascript.i searched lot links but i can't achieve this.Please help me ...
2
votes
1answer
900 views

VisualForce parsing the script and replacing regular expressions

I have some script to denormalize the tags that get normalized in the Ajax return. The problem is that when I do: str.replace( /&amp;/g, "&" ) in my script, the VisualForce page rendering ...
2
votes
1answer
2k views

CheckALL doesn't visually show all checkboxes as checked in Visualforce

I implemented a checkbox class with a checkaLL function(called using javascript) which makes sure to select All checkboxes as it should. However, the problem is that it doesn't visually show the ...
7
votes
1answer
9k views

Error while trying to use `sforce.apex.execute`

I was trying to use the sforce.apex.execute in javascript using <script src="/soap/ajax/15.0/connection.js" type="text/javascript"></script> <script src="/soap/ajax/15.0/apex.js" type=...
5
votes
2answers
2k views

Spellcheck within a custom object/textarea/Notes field

And now, some backstory. I have no previous Salesforce experience, and I'm an emerging developer. I work for a company that uses the Opportunities section to track clients and the insurance products ...
2
votes
1answer
592 views

Clicking on the custom component in sidebar should load on the same page

I have created a custom Html area component on the sidebar , which contains links which are linked to corresponding VF pages , how can i make it to load on the same page
1
vote
2answers
6k views

How to get the Role of the currently logged in user

Is there any possibilities to get the Role of the current user who has logged in to my application by using javascript or some other ways
2
votes
2answers
1k views

How to de normalize text saved in a text area with HTML tags

I have an object that I've entered text with HTML snippets that I want to insert into a page using JavaScript. When the string is passed in the object(s) using Apex, the strings are normalized so that ...
7
votes
2answers
3k views

reRender not being called, yet controller is executing

I'm stuck on a reRender issue. I have a commandButton element which calls an action function, which should reRender a pageBlock on return and then trigger an oncomplete event. Action button in ...
2
votes
2answers
2k views

How can I hide the Attach File button from Notes & Attachments related list?

My client is using Professional Edition. They want to remove or hide the 'Attach File' button from the Notes & Attachments Related list which is available in Account,Contact and Opportunity ...
3
votes
1answer
8k views

Javascript alert on button click

I want to prevent users from being redirected when they click a button and picklist value is false. I have a custom button on Opportunity related list on account. If the value of Account type is 'OLD'...
1
vote
2answers
441 views

Remove the Button “Discover Summer Release” on Home Page

On the Home page, to the top right corner there is a button link "Summer 13 Developers" found. One of my client's requirement is to remove that button on the home page. Im using this code to hide the ...
2
votes
1answer
5k views

Open windows folder from custom button or link

I am trying to open a windows folder like my computer or my documents or a network folder using a custom button or custom link of an object in salesforce. i.e by clicking that button or link a ...
1
vote
1answer
14k views

Can I have a two line text in a select option value

Can I have a two line text in a select option value in Salesforce? Please let me know if there is a work around if not. thanks sanjib
5
votes
2answers
734 views

How to share JavaScript between Custom Buttons and Visualforce pages?

Is there any way we can add Execute Javascript custom page button to Visualforce page and reuse it. I am just checking if any way we can save writing JS code is button again in VF page. MY ...
4
votes
1answer
967 views

Catching all errors when using ajax toolkit

I am writing some javascript to be executed by a custom button on a Lead page. I would like to capture all of the validation errors that may be thrown when I update the page. It seems that if I save ...
1
vote
1answer
2k views

Sending email with javascript on custom button

I am trying to select the appropriate email template using javascript on a custom button. Here is a stripped down version of my code: var template; var type = "{!My_Custom_Object__c.My_Field__c}"; ...
6
votes
1answer
883 views

input type color and upload file

I'm trying to allow a user to both upload a document and utilize the HTML input type="color". Then click Save and have both saved to the record. The color as a field on the record, the file as an ...
1
vote
2answers
987 views

What Javascript code is required to convert a lead to account

I want my agents to be able to convert a lead to an account from the lead list view. I have created the custom button but need the appropriate code. I used what was suggested but get a message Missing ...
3
votes
1answer
17k views

Wait for .each & contained async calls to complete before redirect

Using JS REST toolkit, I'm trying to insert one customer record and multiple related contact records, and then redirect to the detail page of the customer record via JS. The problem is JS redirects ...
1
vote
1answer
1k views

Adding Date and Integer in jQuery

<script type="text/javascript"> function duedatecal(){ var dmy = $(".invoicedate").val().split("/"); alert(dmy); // it is in the format of mm/dd/yyyy var invoicedate = new Date( ...
1
vote
1answer
6k views

VisualForce page with custom controller and lookup causing JavaScript UI issues

I noticed that I'm experiencing UI issues with every Salesforce instance that I have access to when I create a custom VisualForce page using a custom controller and that I display a lookup field on it....
3
votes
1answer
2k views

Enabling a field in input page based on a picklist value

VF page to enable one of two fields based on picklist value in the same page. Please verify my code whether is right or worng. I am running this code but nothing happen. <apex:page ...
2
votes
1answer
2k views

Cross-site Scripting (XSS) in security review.?

I am getting Cross-site Scripting (XSS) while scanning in force.com scanner.if i remove javascript there is no error..what to change in javascript code..please help its quite urgent...may be encode ...
2
votes
2answers
365 views

Date coming back in wrong format using JS remoting

I return instances of an APEX Class in a JS remoting API. public class OpportunityDetail { ... public Date closeDate; ... The problem what is returned to my JavaScript client code is ...
2
votes
1answer
2k views

Creating a VF page dependent picklist error?

I am creating a VF page, on that we need to have 13 picklist fields and 13 dependent picklist fiields. We have created 10 picklist fields and 10 dependent picklist field. For creating 11th dependent ...
2
votes
1answer
6k views

Custom Button Javascript - send Validation Error Text to screen?

Is there a way to send (if any) the Validation Error text to such a button, shown below? I would put it at the "Error" text at the end, if possible. I cannot find a reference to this in my searches. ...
1
vote
2answers
2k views

Apex:include should only rendered When onclick event occurs

I'm having a page Say VFPage1 with class apex1 In my page2, my code is something like this var arr = document.getElementById("contactandaccount"); alert(arr); //getting null here <apex:define ...
1
vote
1answer
2k views

Display javascript result in a pageblocktable

I am making a Ajax call to a REST API and parsing the response and maintaining the parsed values in a delimited string. I want to display the same string in the pageblocktable without taking the ...
1
vote
1answer
1k views

Hiding chatter feed in service cloud console

We have a requirement to hide the chatter feed for Accounts for service cloud console users. The chatter feed is contained within two divs on the Account page, with ids 'feedLinks' and '...
2
votes
3answers
4k views

Passing apex:inputField user entry as parameter into Command Link

I am getting the nickname from an inputField and updating a list of strings and displaying the list of strings on a table. The outputField displays the newly entered value, but the controller variable ...
1
vote
2answers
3k views

How do we get a id of field from a apex:pageBlockTable?

I have a pageblocktable where i do have some input fields which also has a apex:inputtext and has a lookup icon on click of which i am calling up the native lookup. The issue i am having is with the ...
2
votes
1answer
8k views

send email button from custom object

I am a newbie, and that's the probably reason why I am lost with this problem. I have two email templates created (one for students, and another for professorial). There is a custom object, and I need ...
1
vote
1answer
2k views

Dynamic table in salesforce using HTML

I have a list of record in my controller. I want to display the record into my VF page but don't want to use salesorce components want to display the list into a HTML table 1 by 1. How to achieve this....
1
vote
0answers
207 views

How to embed a standard delete page into a custom console?

I have a custom console, with the essential registers and the user can delete an object through this page. When he click on Delete I want show him the standard delete page without the sidebar and ...
3
votes
2answers
1k views

parameters wont passs via Javascript

I am having trouble passing values via Javascript. APEX PAGE: //STUFF HERE <b>First Goal:</b><br /><br /> Goal:<apex:inputField id="Goal" value="{!Account_Plan__c....
2
votes
1answer
2k views

Custom Button for Convert Lead with Javascript

I would like to prevent users from converting a lead if some fields are missing (State, country, company type) - I don't want to use standard validation, as I want the users to remain on the same ...
2
votes
3answers
2k views

Standard Button CODE Available?

Is there a repository of the actual code behind Standard Buttons? Specifically, I'm looking for the code for "New" (and in my case, it's for use within a Related List on Opportunity). I want to ...
3
votes
1answer
2k views

Can't update record with Javascript remoting

I'm using JS function to get a contact record and another function to update the record after hitting save. getRemoteContact() works beautifully, but saveRemoteContact() only works at random. I've ...
-3
votes
1answer
545 views

Visualization chart not being displayed

I'm using the code below but it is no showing any chart, is there an obvious reason why? < script type="text/javascript" src="http://google.com/jsapi"></script> <script src="/...
0
votes
2answers
4k views

How can I redirect the page to navigate to a new record (Case) that was created with a custom button?

I have a custom Javascript button on Opportunity Layout that executes a method that creates a case. After the alert says "Case Created" and User clicked OK, I want the page to redirect to the Case ...
4
votes
1answer
3k views

Manage (and re-use) apex:pageMessages from Javascript

I would like to know if is possible to set and show a apex:pageMessages block from javascript I've been trying to do something like this: VF page: ... <apex:pageMessages id="jserror"/> ... &...
2
votes
2answers
3k views

Setting color for multiselect picklist

EDIT:Sorry for not specifying this critical part. I want this to be done on a Multi select picklist on standard salesforce *(even if it means hacking the side row by adding a dummy component) and not ...