Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Can't update record with javascript. what am I doing wrong?

$
0
0

I'm trying to update a record using the XRMSVCTOOLKIT, I keep getting an error that the record was not found, but looking at the ConnectionSet entity, I can see my record with the GUID is there, but it keeps giving me a status 404.

Here is the code I am using:

function onSave(){
var ID = Xrm.Page.data.entity.getId();
alert(ID);
var CaseType = Xrm.Page.getAttribute("new_blank").getValue();
alert(CaseType);
            //Toolkit to update the data
            XrmSvcToolkit.updateRecord({
            //Entity we are updating
            entityName: "Connection",
            //Entity ID, taken from above
            id: ID,
            //Attribute, but Schema name not name of entity
            entity: {
                new_blank: CaseType
            },
            async: false,
            successCallback: function(result) {},
            errorCallback: function(error) {
                alert("There was an error when updating the contact record");
            }
        });	
}

Any ideas on how to solve this?


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>