Rest Update command

Jun 15, 2012 at 12:56 AM

Im trying to follow the example for using the rest update command in the toolkit but am having problems.  below is the code that I am using. above this I do have account Id defined.  the field I want to update on the account is called    abc_openhdcases    when I run this with IE debugger I get the error

XrmServiceToolkit.REST.updateRecord requires the successCallback is a function.

 

 


            var account = {};
            account.abc_openhdcases = openhdcases;
           
            XrmServiceToolkit.Rest.Update(
                accountId,
                account,
                "AccountSet");

the documentation online has some extra functions that pair with the word equals that was throwing a different error when in my code. I assumed those were part of the test suite used to create the samples so I took them out. did I remove to much. 

Jun 15, 2012 at 1:26 AM

nevermind I figured it out I put the functions back in a removed just the equals 

 

 


            var account = {};
            account.abc_openhdcases = openhdcases;
           
            XrmServiceToolkit.Rest.Update(
                '53DA56CA-D0BA-E011-876C-1CC1DEEAE7D7',
                account,
                "AccountSet",
function () {
                    (true, true, "The record should have been updated.");
                },
                function (error) {
                    (true, false, error.message);
                },
                false
            );

Coordinator
Jul 25, 2012 at 10:41 AM
var account = {};
account.abc_openhdcases = openhdcases;
            
XrmServiceToolkit.Rest.Update(
   '53DA56CA-D0BA-E011-876C-1CC1DEEAE7D7',
    account,
    "AccountSet",
    function () {
         //add your logic here
         alert("Record updated");
    },
    function (error) {
          alert(error.message);
    },
    false
);