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
2
votes
1answer
3k views

Passing a javascript variable value to component attribute value

I have a VF custom component with attribute called chartHeight. I need to assign chartHeight a value from the VF page the component resides in, and this value should be screen.availHeight retrived ...
1
vote
1answer
2k views

Iterate over custom list setting and return all entries

If I have a custom list setting, 'Info_List__c' with 1 field, 'Info_Field__c'. What would a method look like that would iterate through the list and return all entries. And how would I call that ...
2
votes
2answers
401 views

Is there a bug in the way custom buttons handle checkboxes on related objects?

I'm creating a custom execute JavaScript button for the Opportunity detail page and trying to use an IF statement to conditionally load a resource with REQUIRESCRIPT. The goal is to base the ...
6
votes
1answer
2k views

pass blob from javascript to apex

I have an apex method that takes in a Blob input argument and needs to be called from javascript. When I pass in a Javascript Blob, I get what seems to a be type mismatch error from VFRemote.js: "...
2
votes
1answer
630 views

Restrict Month & Year value as per current date in Visualforce

I have two output field below to display drop down values of year and month. But there is no restrictions on which year and month user can select. could you pls guide me how to add an restriction so ...
1
vote
1answer
960 views

How to execute Jquery logic when inputCheckbox is checked true, but not execute jQuery when inputCheckbox is false

<apex:inputCheckbox styleClass="billCopy">Same as Above To Address </apex:inputCheckbox> <apex:includeScript value="//code.jquery.com/jquery-1.11.0.min.js"/> <script> var ...
2
votes
1answer
1k views

How to prepopulate custom fields by URL hacking?

I am able to copy and save a new custom object from a JS button in Account detail like this.. {!REQUIRESCRIPT('/soap/ajax/27.0/connection.js')} var fb=new sforce.SObject("Feedback__c"); fb.Name=...
1
vote
0answers
1k views

Need to create a new custom object record (new order) based on the current page record (current order) using custom VF

I have an Order custom object which consists of order items. Once this order is delivered to a a store for a customer, I want to add a button (on the order) that allows the employee to reorder any ...
9
votes
2answers
1k views

testing angularjs on visualforce

Doing angularjs on visualforce in a big way lately, using lots of ngforce. In all the mainstream (ie, non-force.com) angular, there's some slick unit testing stuff. But it looks like the assumption ...
4
votes
1answer
624 views

Visual Force Page Not Displayed On SalesForce1 Community Version Only

I applied my custom VF page to a global action, works perfectly internally, however, when using the community the page does not display. The page has been checked for displaying on mobile, permission ...
1
vote
2answers
205 views

Public Site is not displaying dashboard

I displayed visualforce page as public site. But as soon as I added a dashboard onto the visualforce page using the following code.... APEX public String getDashboardHtml(){ PageReference ...
2
votes
2answers
1k views

Get Current User when using forcetk.js / JqueryMobile pack

Im currently having a play with the Salesforce JqueryMobile pack and have got stuck trying to get hold of the current user Id. (Pack: http://www2.developerforce.com/mobile/getting-started/html5/#...
1
vote
0answers
711 views

Upload images to portfolio using Server Side JavaScript

I have a simple html file upload page, an example snippet of the code below. <html> <body> <form action="<ExactTarget page with ssjs file handling>" method="post" ...
3
votes
3answers
12k views

how to call the javascript function through ActionFunction?

In The below code the submitEmp() method not working can any one tell me how to call the javascript function through the ActionFunction <script> function innerJavascript(){ alert('Start ...
2
votes
1answer
8k views

How to use Javascript to validate required field entry on a VF page

I cannot and don't want to use required attribute because it is giving me so many rerendering issues as my page has so many dynamic fields based on different conditions, I am attaching the sample code....
0
votes
1answer
5k views

Jquery Validation in Visualforce Page

I need to validate the Account.Unit__c field using some jquery dialog box.But I am having difficulty in getting visual force component Id in jquery. Update I followed Keith C recommendation and ...
1
vote
1answer
1k views

HTMLElement.click() not working in IE10 for custom button

I created a custom button on the Quote object that executes JavaScript, and everything works fine except for a critical call to HTMLElement.click(). The kickers to this problem are: The button works ...
0
votes
2answers
711 views

round a value to .0 or .5

I'm looking for a way to round a value to .0 or to .5, so 1,34 would become 1.5, 1.22 would become 1.0, 1.63 would become 1.5, and 1.79 would become 2.0. Is there a function to accomplish ...
1
vote
1answer
990 views

How to prepend text to Img src value

I have this code: <td><apex:outputText value="{!e.p.Imagen_Producto__c}" escape="false"></apex:outputText></td> where the value "{!e.p.Imagen_Producto__c}" is equivalent to ...
1
vote
1answer
948 views

Script for hidding outputPanel when pageblock section is collapsed

Here is what I am trying to do. We have a table which as several rows and columns. This table is placed under a pageBlockSection which is collapsed when the page is loaded using a script. What I ...
1
vote
1answer
602 views

Update LastModifiedDate field of custom object

I'm uploading attachments to a custom object using the following JS. I want to update the LastModifiedDate field of the custom object each time I do this. Would anyone have any suggestions as to how I ...
3
votes
1answer
4k views

OnClick Javascript Ajax Toolkit: Syntax to evaluate Sobject field within if expression

I have a Javascript button on Case that merely changes the owner when clicked, so far so good. But I'd like to extend it with a tiny bit of validation that chck to see whether there's a picklist ...
2
votes
2answers
348 views

Timezone object and SSJS

I am working on a fix for a User Initiated send created from SSJS. We create the email send definition and add the appropriate properties (CustomerKey, Name, IsMultipart, SendClassification, ...
4
votes
1answer
3k views

inputfield with type date using twitter bootstrap

I have a page that contain inputField with type (date), And I used bootstrap framework css and turned off the standard style sheet.. but the date field appeared without datepicker and i put type="date"...
2
votes
1answer
481 views

Weird Javascript remoting error

I'm using javascript remoting in a SKUID page. Everything has been working fine, but without any code changes all of a sudden I started getting this error: function handleRemoteCall(result, event) {...
1
vote
1answer
51 views

Custom CloseDate returns a double and when i convert it back to a date it is the wrong date using Javascript

I created a JS button that creates an Opportunity and it populates certain fields with data from another Object (custom object called Deals). All the fields are working as they should except for ...
0
votes
1answer
256 views

Using SSJS to retrieve bounce data

I'd like to create an SSJS script which retrieves bounced emails from a send activity. I've tried testing by creating a simple landing page and started by retrieving sent emails for now, but it just ...
1
vote
2answers
645 views

Javascript button to check whether an object exists

I have a button on the opportunity detail page which currently directs my user to a visualforce wizard. However, if the user has already been through the wizard for that opportunity, I want it to take ...
2
votes
2answers
6k views

window.location not working

I am stuck in a situation, hope so I could get some help here. I'm having a condition where I want to redirect a page to one URL. It is related to service cloud console. In controller I defined a ...
2
votes
2answers
3k views

Return list of records from Salesforce Object with JavaScript

How could I return a list of records using only javascript, with no apex: elements. My original approach was to use an apex:repeat like so: <apex:repeat value="{!attachments}" var="attach"> ...
2
votes
1answer
4k views

Call a method with parameters from script in a Visualforce page

I want to call a apex method with parameters from my script in a visualforce page and use the return value to feed a inputField. I tried to explain it in the code here(hope you understand my request): ...
0
votes
1answer
810 views

Issues moving a page into VisualForce

have a page that was coded outside of force.com and I have to move it into a Visualforce page. Then, just for kicks, I took the source of the page out of force.com (where it doesn't work) and created ...
1
vote
1answer
132 views

Conflict in actions inside block table

I have a table with two actions, first is delete record If i click on delete icon (commandLink), the second action get record Info when I click on the row. but If I click on delete (Icon) the two ...
2
votes
1answer
860 views

Can I append apex elements to html with jQuery?

In a visualforce page, if I have a DOM completely created dynamically with jQuery, could I append the following code dynamically too? <div id="file"> <apex:inputFile value="{!...
4
votes
1answer
3k views

Collapse Inline Visualforce section on standard page layout

By default I want my inline visual force section to be collapsed.I can only see show scrollbar,Height,Width and Show label under pagelayout settings.I know salesforce remembers the collapsed state.But ...
0
votes
1answer
836 views

Passing Javascript Value to Controller is Nulling

I am trying to pass from my JS to my controller and in the console log, All the values appear correctly. When I check the controller they are all null. I have looked it over 1000 Times. It could be a ...
3
votes
1answer
4k views

How to hide fields (input) by jQuery - Visualforce

I would like to show or hide fields depending on the value of another field. I was not able to find and implement the existing topics. function selectService (){ if($jquery('[id$=inField1]').val() ...
3
votes
0answers
3k views

Adding SSJS Script Activity to ExactTarget Automation Studio

we need to do the following and I'm rather lost of where to begin, so I was hoping someone could point me in the right direction. We need to create an SSJS Script Activity to Automation Studio (this ...
5
votes
1answer
1k views

How to load static javascript resource in HTML Component

I've uploaded a jQuery library document into our SF Shared Documents and want to be able to reference that document in a sidebar HTML component. I've tried many variations of the below with no luck: &...
2
votes
2answers
2k views

JavaScript doesn't work with Apex command Button

I was able to get the id of the button but no able to get the outputText id. Please help <script > function exButton(){ var remainingValues = document.getElementById("j_id0:j_id5:...
1
vote
1answer
5k views

Javascript Remoting to display a table of records

Have been trying to learn Javascript Remoting since hours. I have manipulated this example to display a table of records with remoting an apex class. Following is the controller and VF.. My controller ...
2
votes
1answer
254 views

Javascript Button that works for some reason

I created a button which will update SAPReleased__c only if Approved__c is true(SAPReleased__c and Approved__c are both check boxes). What I don't understand is.. Why is this working!?? ...
0
votes
1answer
2k views

How to Using JSON with visualforce

I'm new on visualforce and JSON, and I have a page that have many inputFields want to insert them by clicking on save, and get them back on click on edit button for example, I searched on google for ...
1
vote
1answer
1k views

Visualforce - Display Controller Extension Member Variable Data

My VF Page : <apex:page standardcontroller="Expense__c" extensions="ExpenseController" sidebar="false" showHeader="true" showChat="false" recordSetVar="exp" > <script src="../../soap/ajax/...
2
votes
2answers
2k views

JavaScript file in a static resource [duplicate]

I have a two JavaScript (.js) files in a static resource. When I enter the full URL of a JavaScript file in the browser, https://uknow.cs14.my.salesforce.com/resource/1301087741200/VExpander/easyXDM....
3
votes
1answer
624 views

Where is 'emailauthor.jsp' is coming from?

I've created a custom button sending email some time ago following these instructions: https://success.salesforce.com/answers?id=90630000000gtNyAAI I just realized i do not understand where this ...
1
vote
1answer
1k views

JavaScript Button

I have a JavaScript button that is meant to set SAPReleased__c = "True" whenever it is pushed. Now this should only work when Approved__c is True. This is my current code which isn't working.. Any ...
0
votes
1answer
309 views

ajax toolkit : Javascript alert not displaying any value

This is OnClick Javascript code invoked from a List Button on a related list UI. var cid = '{!Case.Id}'; varQueryString = "select id,integration_status__c,Target_System__c from transaction__c ...
2
votes
1answer
624 views

Visualforce: Link to open a Activity task in Salesforce 1

I have worked on displaying a google map which displays all contacts related to a campaign on the campaign detail page. On every marker, I have added a button which when clicked opens the "Log a ...
2
votes
1answer
590 views

Odd results from JSENCODE when merging foreign key Name fields in custom JavaScript button

I've got a custom JS button on a custom object call Card, and the Card object is child to Contract (via Lookup). That JS button (called New Adult Card) shows up on the Cards related list on the ...

1
75 76
77
78 79
83