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
0
votes
1answer
38 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 "...
0
votes
1answer
72 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 ...
2
votes
1answer
35 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 "...
1
vote
1answer
48 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 ...
1
vote
1answer
996 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. ...
0
votes
2answers
448 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:...
0
votes
1answer
214 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 ...
0
votes
1answer
53 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(); ...
0
votes
1answer
53 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 ...
0
votes
1answer
2k 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', }, ...
1
vote
3answers
595 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 ...
0
votes
1answer
3k 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 ...
0
votes
1answer
1k 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 = ...
2
votes
3answers
530 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 ...
1
vote
1answer
79 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....
0
votes
1answer
184 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 ...
0
votes
1answer
387 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"...
1
vote
0answers
153 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 ...
3
votes
2answers
6k 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) {...
0
votes
0answers
199 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="...
5
votes
1answer
159 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 ...
0
votes
2answers
468 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.
0
votes
2answers
216 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 ...
0
votes
1answer
169 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 ...
0
votes
1answer
156 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 =...
1
vote
1answer
709 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 ...
0
votes
1answer
876 views

How to close a primary tab

I need to open a vf page in same primary tab by closing the current primary tab on clicking the custom button in the detail page. {!REQUIRESCRIPT("/support/console/36.0/integration.js")} {!...
0
votes
0answers
67 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 ...
1
vote
2answers
406 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....
1
vote
1answer
437 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....
1
vote
1answer
95 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/...
0
votes
1answer
452 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, ...
2
votes
1answer
195 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 ...
1
vote
0answers
32 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 ...
0
votes
2answers
787 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 ...
1
vote
1answer
304 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 ='{!...
0
votes
1answer
386 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 ...
0
votes
1answer
466 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();
2
votes
0answers
103 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, ...
4
votes
2answers
69 views

Can we use The Salesforce AJAX Toolkit in managed packages?

Can we use The Salesforce AJAX Toolkit in managed packages ?
2
votes
0answers
107 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'...
0
votes
2answers
2k 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, ...
1
vote
3answers
1k 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: ...
3
votes
2answers
4k 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 ...
3
votes
0answers
255 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 ...
1
vote
2answers
310 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 ...
1
vote
0answers
55 views

Ajax Tools App Exchange dojo.js not found

Whenever I try to use Ajax Tools installed in any of my Dev Orgs and load it's Explorer tool, I receive a 404 (Not Found) error message preventing me from using the SOQL builder tool that's built into ...
1
vote
1answer
137 views

sforce.connection.remoteFunction() response “double” double quoted?

I'm making a callout to a REST Resource using the sforce.connection.remoteFunction() and getting a strange result. My RestResource returns a String. @RestResource(urlMapping='/demo/*') global class ...
0
votes
0answers
2k views

sforce.apex.execute is not executing method

I am using the ajax/connection js on a custom visual force page <apex:includeScript value="/soap/ajax/34.0/connection.js"/> <apex:includeScript value="/soap/ajax/34.0/apex.js"/> I am ...
5
votes
1answer
366 views

Javascript Remoting vs Consuming Web Service

I am accessing a service side function through a javascript button on a visualforce page and I wanted to know; what is a better solution - Javascript Remoting or the AJAX toolkit (consuming a web ...