Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
13 votes
Accepted

How is heap size calculated?

Salesforce uses SI megabytes in all of their documentation, not SI mebibytes. This is confusing for Windows users and hardware programmers, who are used to seeing mebibytes called megabytes, and may ...
sfdcfox's user avatar
  • 494k
10 votes
Accepted

Javascript Remoting returning JSON with encoded characters. For example &amp

The RemoteAction framework auto-escapes the results by default, to prevent accidental XSS injections for developers using innerHTML to render the contents of a callback. This is a security feature, ...
Eric's user avatar
  • 54.2k
9 votes
Accepted

Javascript remoting for Apex

As for CSRF, @ca_patterson has already answered that on Javascript Remoting CSRF. As for users interacting directly with the methods, it certainly is possible, if someone has the correct knowledge. ...
Adrian Larson's user avatar
  • 150k
8 votes
Accepted

how to convert &#39 ; to single quote in apex

' is escaped HTML Entity, just like (, &, and so on. To unescape most of them in Apex use String.unescapeHtml4() method which Unescapes the characters in a String using HTML 4....
Oleh Berehovskyi's user avatar
7 votes

what happens behind the scenes of salesforce remoting

This question is really interesting, which also force me to think, what's there exactly, and how it works, here is the background: let's understand this process with an example, I created a Class with ...
user2809299's user avatar
7 votes

How can I stop JavaScript remoting reloading page

By default, a button will cause a form submit. You have to prevent this default either by cancelling the default behavior, or by returning "false" from your handler. The easiest method is to simply do ...
sfdcfox's user avatar
  • 494k
6 votes
Accepted

JavaScript Remoting for Apex Controllers

The difference is that in the first example the class name was added directly: TestCtrl.sayHello... And in the second example the $RemoteAction expression was used. Why? Suppose you have an org ...
Sergej Utko's user avatar
6 votes

Javascript remoting for Apex

Cross-Scripting Protection There's a CSRF token that has to be presented in the payload: { "action":"myns.remote", "method":"method", "data":null, "type":"rpc", "tid":2, "ctx": { "csrf": "...
sfdcfox's user avatar
  • 494k
6 votes
Accepted

what happens behind the scenes of salesforce remoting

The AJAX Toolkit is a generic toolkit that is designed to be used anywhere: in a JavaScript button, on your own website, in a Chrome/Firefox/IE browser extension, desktop apps, NodeJS apps, etc. It's ...
sfdcfox's user avatar
  • 494k
5 votes
Accepted

Site.changePassword returns null when called using javascript remoting

The methods of the Site class are designed to work from Visualforce and within a Site so it is possible that the call can't be made to work in your situation. If the context was Visualforce, errors ...
Keith C's user avatar
  • 136k
5 votes
Accepted

Visualforce.remoting.manager.invokeAction Clarification

In the code you included: fetchAttachmentAndNote is your action parentId is the only parameter function(result, event) is your callback you have not specified any configuration details If you wrote ...
Adrian Larson's user avatar
  • 150k
5 votes
Accepted

Bulkify Apex Methods Using Collections In Methods false positive?

Seems like a false positive. In most cases a method that accepts a single record and performs a DML Operation on it might be called in a loop, and hence be considered non-bulk-safe. However, ...
Adrian Larson's user avatar
  • 150k
5 votes

How is heap size calculated?

You have more in the heap than just file data. Heap can be tricky to measure anyway because of garbage collection but you can see how much data you added by taking a diff: Integer startingHeap = ...
Adrian Larson's user avatar
  • 150k
5 votes
Accepted

Visualforce Pagination and Viewstate

If you're going to use remoting, consider grabbing of the ID values, then grab the records you need when you need to load a page. All of this happens client-side. Here's what your controller might ...
sfdcfox's user avatar
  • 494k
5 votes

Tightening security around Javascript Remoting from Visualforce

Even if you could reliably authenticate that the incoming call came from a Visualforce page the next step would be to invoke the Javascript Remoting API from something like the browser's developer ...
ca_peterson's user avatar
4 votes

Polling in lightning component

Here is a good example of setInterval. I found it helpful. Calling Apex method at regular interval from Lightning Component
Lucas Garza's user avatar
4 votes
Accepted

javascript remoting exception handling

The best practice for exception handling will be showing a toast or error message on time out and this can be captured on the callback Since JavaScript remoting you can check for errors in the ...
Mohith Shrivastava's user avatar
4 votes

How to move Remoting apex to static resources

Well there is no specific best practice defined by SFDC for moving inline JS code into file and accessing that using static resource. But, you can take a call based on your needs. Lets first see ...
AtulRajguru9's user avatar
  • 9,120
4 votes
Accepted

Trouble updating a Javascript array from Apex controller via Javascript Remoting method

RemoteAction callback is asynchronous, invoked by the client(browser) when the server returns the response. So the javascript as soon as executes remote action call, it proceeds to the next part of ...
Praveen's user avatar
  • 10.1k
4 votes
Accepted

JavaScript remoting reloading page

The problem is that you're trying to stop the action on keyup. This is too late in the browser's event model to try and do this (it has already decided to perform the default action, which is to ...
sfdcfox's user avatar
  • 494k
4 votes
Accepted

Visualforce.remoting.Manager in a Static Resource used in a Lightning Component

You cannot use Javascript Remoting for lightning components .You will have to annotate your methods with @AuraEnabled and the invocation mechanism for both differ widely . For Javascript Remoting on ...
Mohith Shrivastava's user avatar
4 votes
Accepted

while loading Visual force Page Show Round Progress Bar By clicking a Button in on click javascript

Here's a self-contained example that demonstrates this. I did not use jQuery at all; you can write this fully native in Visualforce. Feel free to replace any parts you don't like. Controller This code ...
sfdcfox's user avatar
  • 494k
4 votes
Accepted

Visualforce Remoting Callback Function

Your "trailing comma" is causing a compiler error, so your method becomes undefined. However, you need to have a callback, even if it does nothing, so just use function() { } for your second parameter....
sfdcfox's user avatar
  • 494k
4 votes
Accepted

Parameter length does not match remote action parameters

[ (square brackets) are not needed to enclose parameters. Visualforce.remoting.Manager.invokeAction( '{!$RemoteAction.ReceiveItemsController.save}', JSON.stringify(list_a), JSON.stringify(...
Ashwani's user avatar
  • 22.6k
4 votes
Accepted

Extra whitespaces being removed during RemoteAction invoke

At first I thought it might be something to do with escape parameter in JavaScript remoting. But issue here is the logs in developer console trims the extra spaces, if you double click on the line or ...
Raul's user avatar
  • 18.8k
4 votes
Accepted

Visualforce not defined

You can't directly reference remoting functions within an external script. Either define them on your page or pass them around in a globally visible object. The latter would look something like: <...
Adrian Larson's user avatar
  • 150k
4 votes
Accepted

Upload large ContentVersion records

Well, I solved this. Sort of. My solution was to forgo the use of a @RemoteAction and instead use Salesforce's REST services. For those following at home home, there are two ways to do this: 1. The ...
AvailableName's user avatar
4 votes
Accepted

Call an apex method when leaving a Visualforce page

Visualforce.remoting.Manager.invokeAction is almost certainly asynchronous in nature. I'm assuming by the time the unload function is completed the browser is about ready to kill everything on the ...
Daniel Ballinger's user avatar
4 votes
Accepted

Lightning Controller window.open();

That's expected. If you don't include the fully qualified URL, window.open assumes you meant "open a URL on the current domain." To open the URL correctly, it should be in the form of https://www....
sfdcfox's user avatar
  • 494k
4 votes
Accepted

Tightening security around Javascript Remoting from Visualforce

If you can't tighten up security that way, you could at least encrypt the data you're using, making it challenging for anyone to do anything with it. For example, consider the following: public String ...
sfdcfox's user avatar
  • 494k

Only top scored, non community-wiki answers of a minimum length are eligible