Questions tagged [ajax]

With AJAX (Asynchronous JavaScript and XML), web applications can send data to, and retrieve data from, a server asynchronously.

Filter by
Sorted by
Tagged with
1
vote
0answers
30 views

Web & Mobile analytics Track Purchase Details with AJAX Redirector Call [closed]

I want to use use ajax call to track purchase items. I found this documentation but it's not very clear in particular how compose the url to pass to the function.
0
votes
2answers
2k views

How to rerender an outputpanel after remoting completes

I have a repeat control that populates commandbuttons(view,edit,delete) for each record of an object. On click of a command button I want to delete the respective record and render the containing ...
5
votes
1answer
5k views

CORS whitelisting not working as expected

I'm having an issue with CORS where I'm unable to make a POST request to a Salesforce site from another site, but one I have listed in my CORS whitelist. Not sure if I have something set up wrong, or ...
2
votes
3answers
842 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 ...
0
votes
1answer
592 views

How do i trigger a form submit after validating with <apex:actionFunction>?

I have a form that i need to validate 1 field by the controller, what is the right way to to preform validation with the controller and by the answer to preform form submission?? Heres the VFP code: ...
1
vote
0answers
180 views

Ajax call to data extension

Client wants to direct people to a landing page. Within the landing page, there is a registration page that takes some information from the user. One of the questions is for the user to select from a ...
1
vote
1answer
26k views

Response status is '0' in jquery ajax

I'm using a jquery ajax for storing a data in the database. I call a service through a url and send data to it in the following way: $.ajax({ type: "POST", url: "http://192.168.250.118:8080/...
0
votes
1answer
4k views

how to insert ajax result json format into Datatable?

$.ajax({ url: "apex/demopage", success: function(resp) { } }) //and my resp coming as follows [ { "attributes": { "type": "something", "url": "...
6
votes
1answer
1k views

How To Stop actionPoller After Set Duration?

Can we stop the <apex:actionPoller> from executing after a set duration?
0
votes
1answer
123 views

Populate a form field based on lookup value by AJAX

I am having a bit of trouble with working out how to populate a field on my custom object based on the selection of a related object record via lookup. I have 2 custom objects - Case_Item__c and ...
1
vote
1answer
122 views

How can I pre-populate a field based on a connection.js query result?

The query itself seems to work, but getting its result (the Campaign Name) into the desired field doesn't work. As it is, the code results in the field being populated with: {done:'true', ...
1
vote
1answer
562 views

jquery.ajax in Visualforce

I don't konw whether there are some error in my code, so does anyone have experiences about use jquery.ajax in Visualforce or how to post a request to an external service in Visualforce? When this ...
0
votes
0answers
53 views

Salesforce Ajax call throwing exception

I have the following ajax call that I am sending to an outside domain. but it straights goes to error function is there something that I am missing . I have added the url into remote setting $....
2
votes
1answer
760 views

Lightning component lazy loading

Is it possible to insert a lazy loading into a picklist : so while the list is loading, the rest of my page is displayed. For now, the list I have to display is so long (due to the request I think) ...
1
vote
1answer
241 views

Javascript to POST to apex rest resource gets Invalid Session ID, but POSTing from third-paty services doesnt, what am I missing?

I'm trying to call into Salesforce via Ajax from another site. I've verified the content of my request is correct using a service to call in using the same JSON and auth token and everything, but when ...
1
vote
1answer
4k views

Execute Javascript after ActionFunction completes

I have the following on a Visualforce page: <apex:actionFunction action="{!updateName}" name="updateName"/> <apex:inputField value="{!C.Name}" onChange="processName();"/> <script> ...
3
votes
1answer
7k views

Assertion Failed on custom object - Lightning component

I have been developing a basic lightning component to return all the names of my custom object "competitor" but am being thrown this error? Assertion Failed!: Unable to get value for key '...
0
votes
0answers
106 views

How do I download a file from chatter in visualforce page?

I am new to Salesforce. I have a large xml file in Chatter/Files that I need to download and process on the client. How can I get the file? I am able to get static resources via ajax, but this file is ...
1
vote
1answer
288 views

Custom Search Lightning component cannot read property. (community)

I have been trying to implement a custom search in communities whereby the user can type in the first line of the address and the search will update with each keystroke. But I receive this error: ...
-1
votes
1answer
476 views

calling apex method in Ajax on click of input tag

<apex:page standardController="Account" extensions="showDuplicates"> <apex:form > <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/...
1
vote
1answer
746 views

Display time remaining before apex:actionPoller refresh

Is there any way to easily display to the user how long between actionPoller refreshes? I tried using the onSubmit and onComplete event attributes in the actionPoller tag to call a timer function, ...
1
vote
2answers
724 views

Get id of an record on click of checkbox

I need to get the id of an record on the click of checkbox. I am able to get the id in outputText though. public class AjaxUtility { public List<Account> accList{get;set;} public List&...
1
vote
0answers
332 views

Submitting form in landing page (cloud pages) using ajax? [closed]

I have several forms in a Cloud Pages Landing Page. Using smart capture will not work to submit them since some of the forms are inside list items and the success message needs to be in a list item ...
0
votes
1answer
415 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"...
3
votes
2answers
8k 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
2answers
571 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
698 views

Show Loading gif after onchange() in inputField

I have a very simple VF page that calls a method in my controller to populate a selectoptions. The method in my controller calls an external API so it takes a bit of time to populate selectoptions. ...
0
votes
1answer
216 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 ...
3
votes
1answer
2k views

Possible to Set Access-Control-Allow-Origin in an SFMC Landingpage?

we want load some content from an SFMC Landingpage using AJAX on our Webpage. But its not working in every Browser because the CORS Access-Control-Allow-Origin is missing on the SFMC Landingpage. Is ...
3
votes
2answers
1k views

Set timeout always 10 seconds for remoteFunction [duplicate]

When the onLoad function is called this code runs. The timeout is set to 2 minutes but the server always returns an error after 10 seconds despite the timeout field. How can I set the timeout to be ...
1
vote
1answer
505 views

Problem with showing errors with ActionFunction

Disclaimer : This is an homework exercise. Sort of. I'm trying to learn Visualforce + APEX + web design in a very short term, so I'm asking my friends to put up challenging questions for me. VF page ...
1
vote
0answers
40 views

Error on custom javascript button

Below code should update the Leadership_Notification_check__c when the Suite, RedLightReview are not empty, TOV >= 5000000000 and check field is 0. {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}...
0
votes
1answer
45 views

How can I execute Javascipt after rerendering a component?

I have the following code: <apex:actionFunction name="saveRecords" action="{!saveRecords}" reRender="recordsTable" oncomplete="saveComplete();"/> However the code I ...
2
votes
0answers
72 views

How to resolve the problem of refreshing standard page multiple times until callout completes?

We are using opportunity custom button to populate the value of a field based on the response form future callout. In order to receive the value we had to keep refreshing the opportunity page until ...
3
votes
2answers
423 views

Global AjaxStart and Stop event on visualforce page

I am new to Salesforce and I want to achieve what I used to do in html pages. I defined ajaxStart ans Stop event and want it to be called whenever Apex execute it's actionFunction using Ajax. here is ...
3
votes
2answers
339 views

Manually Enforce CRUD and FLS in trigger handler and Ajax to pass salesforce security review

I want to pass salesforce security review in my app. I want to make sure that all the known issues fixed before submission. I have Enforced CRUD and FLS in to all the apex classes. But i am not sure ...
3
votes
1answer
158 views

Can't get Custom Object ParentID for Attachment save

I'm uploading an attachment via "sforce" following the example here: Upload attachment in VisualForce without reloading the whole page However I'm having problems getting a value for ParentId. I ...
1
vote
1answer
1k views

Visualforce Picklist from Javascript Query

Can I draw a Picklist in a Visualforce with a Javascript query? With de ajax connection.js in visualforce, I'm trying to retrieve a list of some values, Ex: var qr = sforce.connection.query(“SELECT ...
0
votes
1answer
405 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 ...
2
votes
1answer
693 views

Is it possible to use Ajax to POST data from within a Server-Side Javascript in the Marketing Cloud?

Is it possible to use Ajax to POST data from within a Server-Side Javascript in the Marketing Cloud? Could the FormData be a problem? I've been using this code: var form = new FormData(); form....
1
vote
1answer
904 views

AJAX - Can I reference a method from the controller by url?

I am wondering if I can use the standard $.ajax, $.post or $.get with visual force. If so what do I put in the url? Can I get the url of the method I want to make a call to?
4
votes
1answer
2k views

Disable Custom Button in Standard Page Layout

We have a custom button in Opportunity standard page layout and when clicked it calls a webservice class (Apex class called by OnClick Javascript via AJAX) It is a synchronous call as such it takes ...
2
votes
2answers
323 views

How do I load Bing Maps in Visualforce?

Using the following code on a Visualforce page does not load the map: <apex:page doctype="xhtml-1.0-transitional" showHeader="true" sidebar="true"> <html> <head> <...
2
votes
1answer
677 views

Need help with custom javascript button to update records

What's best way to update records based on record type using custom button. Below code partially works and fields updates inside 'If block' doesn't work. What I'm missing here ? {!REQUIRESCRIPT("/...
1
vote
1answer
21 views

Instantiating a field of an sObject with a string value passed through AJAX

I am trying to instantiate a sObject in my controller. The information that I am populating about it comes from my AJAX. Including the name of the field that I want to populate + its value. So with ...
1
vote
0answers
267 views

Async javascript call from Visualforce to REST service returns 403 forbidden (only in production)

I have a simple Visualforce page with a couple of input fields and a button (No controller being used here) that, when the button is clicked, sends a JSON payload to an Apex REST service. I am using ...
1
vote
1answer
708 views

Display/Rerender google map with the updated list of addresses

i have displayed google map for accounts(lets say 10 accounts) I have a accounts differentiated by segments. i want to filter out accounts using segment, and based on the result i want to rerender ...
6
votes
1answer
1k views

AJAX load JSON from static resource

I am trying to load a JSON file into my VF app via AJAX. It currently sits in a zipped static resource, like such: myResources | |js | |target.json ...
0
votes
1answer
930 views

Correct way of using apex:actionPoller

I want to refresh pageblock table after every 20 seconds, but it is not working. Can anyone suggest how should I use actionpoller tag in below code VF Page: <apex:page standardController="Case" ...
0
votes
1answer
3k views

Custom button that will open a popup to select from a picklist

I have a requirement to create a custom button that will open a pop up window with some options to select. Currently i've built a VF page and called it from the custom button. But i need to expose ...