Attribute manipulation in Mendix Client 5 API

0
I want to create objects and set their attributes with the WebClient API. I can read some attributes with something like the following: mx.data.get({ xpath : "//System.User", filter : { }, callback : function(objs) { for(i=0;i<objs.length;i++){ console.log("################################################################################"); console.log(objs[i].jsonData.attributes.Name.value); } console.log("################################################################################"); } }); I can create an entity with something like the following: mx.data.create({ entity: "module_foo.entity_bar", callback: function(obj) { console.log("Object created on server"); }, error: function(e) { console.log("an error occured: " + e); } }); What functions may I use to set the attributes of an entity from the WebClient API? Thankyou very much
asked
1 answers
1

I'm still super retarted, but okay thanks cool, maybe something like:

for(var row=0;row<128;row++){
    mx.data.create({
        entity: "MyFirstModule.qwer",
        callback: function(obj) {
            obj.set("qwer", makeid());
            obj.set("asdf", makeid());
            obj.set("zxcv", makeid());
            mx.data.commit({
                mxobj    : obj,
                callback : function() {
                    console.log("Object committed");
                },
                error : function(e) {
                    console.log("Error occurred attempting to commit: " + e);
                }
            });     
        },
        error: function(e) {
            console.log("an error occured: " + e);
        }
    });
}

... I think? How do you ensure serial execution of the above snippets should they occur one after the other?

Thankyou

answered