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
3k views

Load and execute Javascript on the fly (Stored in static resources some other place) with SFDC Buttons on layout

Use Case - There is Javascript execute button on Account page layout named 'Update Account' - {!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")} //...
5
votes
1answer
273 views

Is there away to pull a users standard layout in edit mode and place it on a VF page?

I know there's a ways to do this using tag to view the detail page, but once you hit edit it will use salesforce standard edit page. I've also created a custom edit page but the problem I'm running ...
2
votes
4answers
2k views

Reading a csv file(document) in Jquery

We have a requirement where we want to read a csv document in Jquery / Javascript. We are able to read the file from documents (via query) and Static Resource inside the controller and then pass it ...
2
votes
2answers
3k views

Populate lookup field on Object after Clicking a custom button and creating record on different object

I would like to create a custom button on service contract to create an opportunity. I want to populate a lookup field between service contract and opportunity (So I will be able to use it for some ...
4
votes
1answer
218 views

Is using a class a good option for creating a new Object and how could I send an error string to javascript?

Thank you for taking the time to look into my question, this is my first Apex/Salesforce project, I am familiar with Java and javascript. I have been tasked to creating a new Object called 'Service ...
4
votes
1answer
701 views

Visualforce Remoting and Relationships

Question Is it possible to leverage relationships with Visualforce remoting, including one object as a property of another? Background I've been playing around but always seem to get a VF remoting ...
1
vote
2answers
4k views

onmouseout Event after clicking on link

Here after clicking on the link onmouseout event should be called.I'm very poor in Javascript & need help in this Required something like this when I enter into the block of reporting,& ...
-4
votes
2answers
1k views

Checkbox field popup

I have a checkbox field, and i want if user checks that field then it should ask are you sure,if press ok then it should continue otherwise not?
3
votes
2answers
595 views

Lookup displaying JavaScript error (Internet Explorer)

One of our user is receiving a JS alert when filling a lookup (from a custom object). error: { faultcode: 'soapenv:Client', faultstring: 'Attribute "xmlns" bound to namespace "http://www.w3....
2
votes
1answer
1k views

What fires the activity reminder pop-ups in Salesforce?

Is it tied to a page load? If so, which pages? Or some other element inside the page? Sidebar maybe? Is it possible for a packaged app to interfere with the reminder pop-up function? I'm trying to ...
2
votes
1answer
1k views

VisualForce Page Set URL Parameter w/ Javascript

I have a custom search VisualForce page. I have an inputText area for a search term, upon hitting enter I wan't to pass that value to URL parameter. Trying to do it via JavaScript. I want URL to be ...
0
votes
1answer
316 views

chatterfeed toggle not working post Spring '13

in my application I created a Javascript(posted below) to show and hide chatter feeds in the home page which was working fine till winter release.But post Spring '13 release the chatter toggle ...
1
vote
3answers
8k views

Disable custom button on detail page on some condition..?

I have custom button on standard detail page...I want to disable that button/gray out if my status picklist value is "Approved". Java script on button click var newRecords = []; var o = new sforce....
0
votes
2answers
3k views

javascript for changing outputlabel whenever input value is changed

I have a input field with date date = 1/16/2013 (in the form of inputtext) whenever I change this input text their is an another output text where this value should reflect date1 = 1/16/2013 (in ...
4
votes
2answers
823 views

Does customer portal support ajax?

For example, i have a simple JS button which returns the username of the logged in user. {!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} var name= sforce.connection.getUserInfo(); alert( name....
2
votes
1answer
2k views

Get IDs of checked/ticked records, from list view, in Customer Portal

My custom button works in normal Salesforce UI, but not working in Customer Portal. OnClick JavaScript: var contactIds = {!GETRECORDIDS($ObjectType.Contact)}; if (contactIds.length != 2) { ...
7
votes
2answers
6k views

Decoding HTML String built in the controller

Using JS Remoting I want to generate HTML content in the backend and then display it in the VF page. I am building the string in the controller as per follows: String account = [SELECT Id, Name FROM ...
1
vote
1answer
1k views

How to access pageblock item in Javascript?

<script> var ele=document.getElementById('{!$Component.product_form.product_pageblock.product_section2.Search_Keyword}'); alert('Ele = ' + ele); </script> <apex:form id="...
8
votes
1answer
2k views

Remote Actions and Session Timeout Question

We have a visualforce page that serves as a somewhat live dashboard for information in our salesforce instance. Through javascript and Javascript remoting (remote actions), we are polling salesforce ...
5
votes
4answers
4k views

What is the best way to manage javascript resources for Visualforce pages?

So at the moment when I want to make a quick tweak in a javascript file that enhances a Visualforce page, I have to go: Setup >> Development >> Static Resources Find my script in the list (takes a ...
2
votes
1answer
906 views

What is “ListViewport” and where is it documented?

What is "ListViewport"? I saw that some users use this object. And I can only guess that it is a JavaScript object. But I have found no official description for it. Any ideas? Example from the stack ...
4
votes
5answers
5k views

Cannot get the global variable $Component to return id

How can I get the force.com generated id from the $Component global varible for me apex:selectRadio component? Javascript var rdo = j("input[@id=" + jq('{!$Component.searchRdo}') + "]:checked").val()...
1
vote
1answer
2k views

How to get the updated values after an APEX call from Javascript

I am currently calling an APEX method (in a controller) with variables from Javascript. I would like to reflect the changes made in the controller in the page. I am using an apex:actionFunction to ...
2
votes
1answer
3k views

List View Custom Button to Collect Values of Selected Records

I want to create a JavaScript button to use on list views that when clicked captures a list of the values of a field on all the selected records. GETRECORDIDS returns a set of IDs of selected records. ...
1
vote
1answer
567 views

Passing disbaled input fields values to apex controller

I have a JavaScript function that fills some apex:inputfields and make them disabled so the user cannot change their values. But it seems that values aren't passed to the controller after an action (...
3
votes
1answer
2k views

How to fetch namespace prefix and salesforce instance using javascript?

i am using Custom button & links in List view of Object and on click of button i am executing javascript to redirected to new page and its works fine in my DE but when i install that package in ...
1
vote
2answers
856 views

Use static resource in Javascript/Google Maps

Anyone know if its possible to use static resources to store the marker image for a VF/Google maps combo, e.g. loading the icon below. marker = new google.maps.Marker({position: latlng, map: map, ...
0
votes
1answer
2k views

Naviagate to Previous Page or Close the Window

I am creating a Cancel button for force.com site page. This page is a part of a managed package. I am looking for javascript for this button which can work in two different way. It means, if any user ...
2
votes
3answers
4k views

apex variables used in javascript of VF is not getting updated with latest values

i am currently using a inline VF page to perform an update on an Sobject. The inline Vf page a picklist field and a button which will update the sobject with the values entered in the picklist. Now, ...
7
votes
2answers
22k views

Calling a Apex controller method using JavaScript in VF page

Hi can anybody guide me how to call a method in controller from a VF page.
1
vote
2answers
2k views

Count Custom Button Clicks

I've added a custom button to the opportunity layout. I would like to count the number of times this button was clicked. !REQUIRESCRIPT("/soap/ajax/26.0/connection.js")} //adds the proper code ...
3
votes
2answers
2k views

Javascript Remoting (Return cached result without re-query)

I started writing some code using apex functions and then I thought let's try it out with Javascript remoting. Remoting method was called from my VF page and all worked fine, until I tried to use ...
2
votes
3answers
1k views

Javascript for multiplying fields not working

my javascript is function multiplycal(){ var values=$(".values").val(); var total = 0.0; for(var i=0;i<values;i++) { var amtfield=trim($("....
5
votes
2answers
8k views

how to make field required via javascript

Depending on the value of a picklist I'd like to toggle a set of fields from required to not required. I've been able to add the divs to make it look required 'red bar in inputField'. Its still not ...
3
votes
2answers
269 views

Any ideas on creating a custom button for policy acknowledgement?

A URL field will link to externally hosted policy documentation that users must review and acknowledge once per year. The Salesforce.com system needs to track who has acknowledged the policy and ...
0
votes
1answer
853 views

What the best way to store data from Javascript in “salesforce”

I'm writing a small analytics app in Javascript and want to store data in a database. Since I am new to salesforce I can't figure out the best way to do this: a normal DB such as heroku (postgresql) ...
0
votes
2answers
1k views

How to add the the values in a particluar column under pageblocktable using Javascript?

I have a pageblock table to display the list of accounts and i have few buttons on my VF page like add row,delete etc.User can change the values in the columns and update the records. I want to add ...
2
votes
1answer
1k views

Month validation in javascript

if the month was less than today's month then I should show an error message through javascript in visualforce page.......I have tried but unable to...here is my code /*javascript*/ <script type="...
4
votes
2answers
246 views

Web2Case & HTML 4 Id & Name compliance

I need to provide a webteam with HTML for a web2case form, the issue is that they are sticklers for compliance and insist that I provide them with HTML4 compliant code. Unfortunately the auto-...
1
vote
2answers
3k views

js remoting 'unable to connect to server' error

I am getting 'unable to connect to server' error when using javascript remoting. vf page : function my_custom_object__c(){ this.name = 'test'; } function save(){ var myCustomObject = new ...
2
votes
2answers
1k views

javascript object creation for js remoting

Hi I am trying to use a RemoteAction function from js remoting.The remote function accepts a custom object,so I need to pass it from javascript.For this I m creating a javascript object with all ...
2
votes
3answers
4k views

How to pass specific value in apex:repeat to a javascript function?

Is there a client-side way of passing a value from within an apex:repeat to a javascript function? Basically, my list is iterated, with each unique itemLat / itemLon, and I'd need to pass the ...
3
votes
2answers
8k views

Passing variables from Controller to Page using @RemoteAction

I'm using @remoteAction in my controller. My question is whether I'll be able to pass the controller variable values from the remote method to the page? I tried using static variables in my ...
5
votes
1answer
2k views

How do I line up many Multi-select picklist inputFields on a Visualforce page?

I have 5 different Multi-select picklist fields on an Object. In my Visualforce page I use an <apex:inputField> display them on the page. Visualforce renders two side by side Multi-selects ...
3
votes
3answers
3k views

JavaScript Remoting on Standard Page Layout

I have a couple of JavaScript remoting functions used to count records and to display that count to the end user. The JavaScript remoting functions are on a Visualforce page, and the Visualforce page ...
2
votes
2answers
2k views

Custom button to delete some tasks

I'm trying to create a custom button which deletes a list of Tasks, depending on certain criteria. Here's my custom button code: {!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")} {!REQUIRESCRIPT("/...
5
votes
2answers
940 views

Building HTML with JavaScript remoting

I wrote a little @RemoteAction method that returns a string. And the string is nothing but an HTML snippet that I want inserted on my page. Callback method on the page receives the result and uses ...
0
votes
1answer
2k views

How to include data from custom Lookup Relationships in a Visualforce page

I have a custom object: License, this has a Lookup for the standard Account (meaning: an account can have many licenses) and they are shwon on the account page with a related list. On my account page,...
4
votes
2answers
535 views

Salesforce Standard JavaScript

There are some JavaScript functions used by the standard Salesforce pages that would be useful outside of the Standard pages. For example, the Account page has a "Copy Billing Address to Shipping ...