+ Start a Discussion
LinThawLinThaw 

multiple record update with sfdc.canvas.client.ajax

Hi there,

How to update multiple records with sfdc.canvas.client.ajax?

To update one record I am using following.
function updateAcc()
        {
	        var sr = JSON.parse('<%=signedRequestJson%>');
	        var accId =sr.context.environment.parameters.accountid;
	        var url = sr.context.links.sobjectUrl+"Account/" + accId + "?_HttpMethod=PATCH";
	        var externalId = 'TEST001';
	        var accountInfo = {"Name" : "New Acc Name " + externalId};
		      Sfdc.canvas.client.ajax(url,
		    		{	client : sr.client,
		    			method: 'POST',
		    			contentType: "application/json",
		    			data: JSON.stringify(accountInfo),
		    			success : function(data) {
		    				if (204 === data.status) {
		    					alert("Success");
		    				} else {
		    					alert("Not Success result code : " + data.status);
		    				}
		    			}
		    		});
        }

Thanks in advance.

Regards,
LinThaw​