Javascript REST Web Services PUT query

86 Views Asked by At

can anyone help me with javascript button who make PUT operation.

action : function() {
        var selectedRecords = this.view.viewGrid.getSelectedRecords();
        var lengthAr = selectedRecords.length;
        for (var i=0; i < lengthAr ; i++){
        alert(selectedRecords[i].id);
        }
    },

i want to update one column for all selectedRecords[all]. For this i must make PUT query like this: http://wiki.openbravo.com/wiki/JSON_REST_Web_Services :

     {data: {"_identifier":"United States","_entityName":"Country","$ref":"Country\/100","id":"100","client":
{"_identifier":"System","_entityName":"ADClient","$ref":"ADClient\/0","id":"0","active":true},"organization":
{"_identifier":"*","_entityName":"Organization","$ref":"Organization
... truncated for clarity ...
(USA)","_entityName":"ADLanguage","$ref":"ADLanguage\/192","id":"192","active":true},"currency":{"_identifier":
"USD","_entityName":"Currency","$ref":"Currency\/100","id":"100","active":true},"iBANLength":null,"iBANCode":null}}

but i'm new with javascript and i don't know how to do this. I can't undenstand this code: What is _identifier? should not it be ID from selectedRecords[i].id? How i can write the query in javascript?

0

There are 0 best solutions below