Questions tagged [ajax-toolkit]

The AJAX Toolkit is a JavaScript wrapper around the API. By using the AJAX Toolkit you can embed API calls and processes, such as within a Visualforce page

Filter by
Sorted by
Tagged with
-1 votes
1 answer
59 views

How to get information about user in head markup of community

Experience Builder--> Settings-->Advance-->Head Markup I tested already things like <script src="../../soap/ajax/33.0/connection.js"></script> <script> var ...
Alex's user avatar
  • 1
2 votes
2 answers
4k views

Upload and store 50 MB file from LWC

I have a LWC that, is retrieving the body of an attachment using apex. This is retrieved just as blob, because handling it in Apex would hit limits such as String too long os Heap Size exceeded, cause ...
Gabriel Serrano Salas's user avatar
0 votes
1 answer
87 views

Is there potential security vulnerabilities with connection.js or any reason why should we rewrite existing pages without using this lib?

I work on one of the projects with assessment activities and there are a bunch of Visualforce pages that use the Connections.js library from the AJAX toolkit. As for me, security is the number one ...
Ruslan Kurchenko's user avatar
0 votes
4 answers
86 views

Using Like operator with Ajax Toolkit

I am trying to use like operator in like query using Ajax toolkit, but unable to do so. I am trying this: var att_name = '%sample%'; var result = sforce.connection.query("select id, from ...
Badar's user avatar
  • 45
0 votes
1 answer
180 views

Convert Javascript button in Classic to Lightning which utilizes the AJAX toolkit

Which method is typically used to convert an on click javascript detail page button which utilizes the AJAX toolkit? Looking to call the "forwardEmails" method with the case ID and default value for ...
ebar's user avatar
  • 447
0 votes
1 answer
1k views

How can I overcome a "session is not valid for use with the API" error when accessing AJAX Toolkit as a Community user?

I'm attempting to use the AJAX Toolkit to access the current Account ID of the logged-in user from within a community site. (The particular community is managed by Nimble AMS, and is referred to as "...
Ben Birney's user avatar
0 votes
1 answer
999 views

What is the file limit when using AJAX Toolkit on Visualforce page

I am using html5 FileReader + ajax toolkit + soap API in my Visualforce page to upload a single file as ContentVersion. I'm able to upload files up to 37435519 bytes pdf file but I get this error in ...
Bahman.A's user avatar
  • 838
2 votes
1 answer
107 views

OnClick Javascript button error when merge field value is "St. John's"

I'm working with a Detail Page Button that executes OnClick Javascript. Most of the time it works just fine. However, in this particular instance, one of the merge fields in the script has a value of "...
John Thompson's user avatar
1 vote
1 answer
207 views

need to get callback of new sforce.SObject ajax call

im creating SObject("Attachment") the problem is depends on how big is the file usually it take some amount of seconds do get the results. I want to find a away to alert me when the result comes back ...
Amer Bearat's user avatar
1 vote
1 answer
2k views

sforce.connection is not working from community site.

I've created a Vf Page to upload the attachment in salesforce. I've a pulic community website where user can Register/ login their self. Logged in user can see the attachment Vf page to upload files. ...
user29314's user avatar
  • 303
0 votes
2 answers
1k views

AJAX Toolkit logs error "NetworkError: A network error occurred."

I'm using the Ajax Toolkit to upload files on a VF page, like described here. The Upload works fine, the file is available and not damaged. But the response is not coming back properly. <apex:...
itsmebasti's user avatar
  • 6,437
0 votes
1 answer
432 views

AJAX attachment upload, bad field ParentId

I have a project to upload some files for both licensed users and portal users. Got it working 98%... except for portal users.. mama mia... I created a site off a domain, logged in a user and ...
J.W.'s user avatar
  • 21
0 votes
1 answer
110 views

JavaScript Custom Button behaviour

I have defined a javascript custom button. As soon as the button is clicked, the page should grey out. In mozilla firefox, the below code works as expected: var $j = jQuery.noConflict(); ...
sfdcdev's user avatar
  • 107
0 votes
1 answer
335 views

In Internet Explorer, JavaScript button when clicked does not have the blue border like Chrome

In Chrome when you click a JavaScript button, it will surround the button with a blue border and this indicates the user has clicked the button. In Internet Explorer, this does not happen. Is there ...
sfdcdev's user avatar
  • 107
0 votes
1 answer
6k views

how to retrieve the values from sforce.connection.query

query result: { type: 'Order', Id: null, OwnerOfVehicleRegDocument__r: { type: 'Account', Id: null, Name: 'CK-Carrossier 2', }, ...
Revathy's user avatar
1 vote
3 answers
761 views

Error in javascript button - Unexpected Token else

I have written simple logic to through javascript alert if the description field on account object has some value I am displaying alert and if it null displaying different alert. But the below code ...
saritha sari's user avatar
0 votes
1 answer
5k views

Lightning - [sforce is not defined] [closed]

I have to create a lightning component for an action named 'Next Record' on a child object, which would check the the current records name ('Names are like Test 1, Test 2') and show us the next record ...
Mridula's user avatar
  • 43
0 votes
1 answer
2k views

Not able to create ContentDocumentLink from sforce ajax

I have followed this to create a content version from vf page using sforce ajax and it is working fine. To link the uploaded content to one of my custom object I added the below code; var result1 = ...
Saumya Ranjan Satapathy's user avatar
5 votes
3 answers
1k views

what happens behind the scenes of salesforce remoting

I am new to salesforce and Apex programming. We call remoteactions from javascript in 2 ways. 1.By using namespace.controller.method 2.By using Visualforce.remoting.Manager.invokeAction pattern. I ...
Saranya's user avatar
  • 496
1 vote
1 answer
114 views

User Object access in Ajax Toolkit

One of my standard layout button executes JavaScript as: (Only relevant lines posted) var query = "Select id,Name from User where name ='Integration User' Limit 1"; var records = sforce.connection....
Mukesh Verma's user avatar
  • 1,916
0 votes
1 answer
295 views

Size limit on sforce.connection.remoteFunction?

I am using Ajax Toolkit function sforce.connection.remoteFunction. What are the limitations of this method? For example if I send an encoded Blob content as a request, is there any limitation on the ...
NoNicknameSFDC's user avatar
0 votes
1 answer
542 views

Rest api response error json

enter image description hereI am connecting wave rest api using Ajax toolkit.I am getting error response like the below image if I pass the SAQL to the Wave REST API: <apex:page applyHtmlTag="true"...
Vidhyasagaran Muralidharan's user avatar
1 vote
0 answers
201 views

Ajax Toolkit to connect wave rest api

I am trying to connect the wave rest API via AJAX Toolkit. <apex:page applyHtmlTag="true"> <script src="/soap/ajax/38.0/connection.js" type="text/javascript"></script> <script ...
Vidhyasagaran Muralidharan's user avatar
3 votes
2 answers
14k views

Refused to set unsafe header "User-Agent": connection.js

Don't know why i am getting unsafe header error in console. Everything is working fine but i am wondering what is the error here. Below is the code: function getFieldOptions (objName, ctrlFieldName) {...
Head In Cloud's user avatar
0 votes
0 answers
226 views

Connecting metadata api using ajax toolkit

I am trying to call the metadata api call -reterive in the javascript in vf page. I am getting error load resource: the server responded with a status of 404 (Not Found) <apex:page controller="...
Vidhyasagaran Muralidharan's user avatar
5 votes
1 answer
259 views

How can I add transactional safety to Javascript DML operations?

I am using connection.js and apex.js to add DML operations to a custom VisualForce page with sforce.connection. There are actions in the page that can make multiple calls that will alter data. I'd ...
Chris Payne's user avatar
0 votes
2 answers
702 views

Using AJAX in Salesforce [closed]

I want to create a picklist of all objects of my salesforce org. by the help of AJAX, without using apex controller.I want to achive this functionality by VF page only.
guru's user avatar
  • 23
0 votes
2 answers
698 views

How to get Record ID without Hardcoding it

Can you guys give me an idea on how I can get the Record type id without hard coding it because it may cause an error when it is transferred to another production. This is in a custom button. This is ...
JMDF's user avatar
  • 113
0 votes
1 answer
293 views

Sforce Query Returns only Id and Type

I'm trying to make a custom link that executes some JavaScript in order to look up an Account, but running into an issue. I expect to get the entire Account back, but I'm only getting an sforce.Xml ...
McD's user avatar
  • 1,256
0 votes
1 answer
425 views

sf:INVALID_QUERY_FILTER_OPERATOR [closed]

This is my onclick javascript code {!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/22.0/apex.js" )} sforce.connection.sessionId = "{!$Api.Session_ID}"; var soCount =...
wizard's user avatar
  • 423
1 vote
2 answers
2k views

How to get picklist values based on record type in javascript VF page

I am using Javascript to get picklist values(dependent or normal picklist).Its working fine. But the problem is i am getting all the Picklist values for that object. I have to get picklist values ...
Sathish's user avatar
  • 125
0 votes
0 answers
85 views

How to referesh the primary tab in console after sending the email using custom button

I have a custom button in lead detail page which is used to send an email. After sending the email , i am updating the status from New to In progress. Everything is working fine. But after sending the ...
uma451's user avatar
  • 809
1 vote
2 answers
983 views

Uncaught type error

So I've been running into an odd problem. I am attempting to add a button to a custom visual force page that will change ownership without going to an edit page. For some reason it's throwing an error....
Griffin's user avatar
  • 177
1 vote
1 answer
1k views

How to get org defaults custom settings with SOQL

I am developing custom button, I use ajax tooklit for getting some data, needed as url parameters. As part of it I want to query custom settings, but org defaults only. var token = sforce.connection....
Vladyslav K's user avatar
  • 2,743
1 vote
1 answer
133 views

Not able to mass transfer records based on the condition

I need to have a list button used to assign the records to the corresponding queue based on the lead type. Here is my code . I dont know that part i have missed here. {!REQUIRESCRIPT("/soap/ajax/16.0/...
user29624's user avatar
0 votes
1 answer
890 views

Unable to authenticate with salesforce standard REST API from a different web page using ajax

I want to connect with standard REST API from a different domain using ajax call. Below is the ajax function I am using. function call_API() { $.ajax({ url : URL, ...
user6538424's user avatar
2 votes
1 answer
344 views

Change Query Batch Size in JavaScript?

Is there a way to change the batch size of an ajax toolkit query on the visualforce page itself? I'm working on a proof of concept for a front end only dynamic search and It's working well, but I'm ...
Fred O'Hara's user avatar
1 vote
0 answers
164 views

AJAX Toolkit Version

Why is it so difficult to find the actual version numbers for the JavaScript and Apex toolkits? For instance, how to I check whether {!requireScript("/soap/ajax/37.0/connection.js")} is the most ...
evankincade's user avatar
0 votes
2 answers
1k views

sforce.connection.query is not working for force.com sites

Iam trying to query records using AJAX Toolkit Javascript API through force.com sites. But sforce.connection.query not working through sites. The same code working for internal users. Please find the ...
Murali Mohan Mandadi's user avatar
1 vote
1 answer
436 views

How to get child record value from parent in AJAX toolkit?

I have onclick javascript code: var a = sforce.connection.query("select Name,Net_Price__c,(select Name,Net_Price__c,Price_HT__c from Services__r) from Rfleet_Car_Set__c where id ='{!...
uma451's user avatar
  • 809
0 votes
1 answer
557 views

Custom Javascript Button returns "Unexpected token ILLEGAL"

I'm trying to create a custom button that executes javscript on the Case object. I simply want to check if the Case has a specific child record already and forward the user to that record if it exists ...
jonnybro's user avatar
  • 1,794
0 votes
1 answer
608 views

A problem with Onclick Javascript for this button on link was encountered unexpected identifier

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} Var Ld = new sforce.SObject("Lead"); Ld.id = "{!Lead.Id}"; Ld.Sent_RFI__c = sforce.connection.update([Ld]); window.location.reload();
rashi's user avatar
  • 1
2 votes
0 answers
163 views

Preventing SOQL injection when using AJAX toolkit

How can we prevent SOQL injection when using AJAX toolkit while querying records using sforce library. For e.g if there is a query written as below var result = sforce.connection.query("select name, ...
anmrk's user avatar
  • 813
4 votes
2 answers
87 views

Can we use The Salesforce AJAX Toolkit in managed packages?

Can we use The Salesforce AJAX Toolkit in managed packages ?
Raghavendhra Yarlagadda's user avatar
1 vote
0 answers
180 views

AJAX Toolkit login method only creates a 500 Server Error

I'm including apex.js and connection.js (version 32) in some javascript on a preview sandbox running spring'16. I'm trying to use sforce.connection.login(username,passwordAndToken) Unfortunately I'...
Uwe Heim's user avatar
  • 28.4k
0 votes
2 answers
4k views

Custom Clone button on Quote, copies few standard fields but not all, why?

I have a custom button, which i m using to clone Quote Object. I'm using javascript with ajax tool kit, Like in this post. i can clone the quote with few standard fields, but not all, for e.g, ...
naruto-sfdc's user avatar
1 vote
3 answers
2k views

Error OnClick Javascript object is not defined

Hello Guys I got this code on my custom object in a button I want to update some fields. However I keep getting "A problem with the OnClick JavaScript for this button or link was encountered: ...
Nelson Chisoko's user avatar
5 votes
3 answers
10k views

Uncaught reference error: sforce is not defined

I have a vf component in a page which includes a static resource. In the resource, I have a apex method call. Since I am using the same resource in a custom button also, I am using AJAX tool kit ...
sam_s's user avatar
  • 966
3 votes
0 answers
353 views

AJAX Toolkit execute Apex method with inner classes

I have a Visualforce Page where I use the AJAX Toolkit to execute Apex methods. In my Apex Class I have this POC method: WebService static ParametersWrapper testWebserviceMethod(ParametersWrapper ...
Bram's user avatar
  • 473
1 vote
2 answers
327 views

Getting Error in calling apex method from Button action

Can somebody help me with this code I am trying to change the value if the Validated__c field to true whenever the button is clicked. Class Code: global class checkbox{ webservice static void ...
happy's user avatar
  • 363