Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
6894 Näkymät

Hi guys,

Stuck here for quite a few hours now. Anyone who can share what's the correct syntax to call the write method in javascript? So far, I have below code that doesnt work. Thanks !

var model = new instance.web.Model("my.product");
var values = [{'name' : "james"}];
var id = 1;
model.call('write', [[id], values]],  {context: new instance.web.CompoundContext()})
Avatar
Hylkää
Paras vastaus

James try this

model.call("write", [[id], {'name': "james"}])

Avatar
Hylkää
Paras vastaus

Hello,

For this Please do like this :

new instance.web.Model('crm.lead').call('write', [[val]], {})
.then(function(result){
console.log("main resultttttttttttt", result); 
}));

Hope this will help you..

Avatar
Hylkää
Tekijä Paras vastaus

Im getting this error when i do that:


assert isinstance(record_id, (int, long))
AssertionErrorAssertionError

The my.product model has only 2 fields: id and name. Im assuming that (int, long) refers to those 2 fields. I've tried lots of combinations of (, {, [ but nothing seems to work.
Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
heinäk. 25
285
0
kesäk. 25
498
1
kesäk. 25
717
1
kesäk. 25
742
1
toukok. 25
1301