Entity committed using mx.data.commit javascript method is not refreshed immediatly

0
I am trying to commit an Entity as shown below using mx.data.commit javascript method. I am getting empty reference when I try to get the reference on Session object after this commit statement. I am not getting data using Session association  in Microflow  that is invoked on a button click after this commit. mx.data.create({                                 entity: "MyAppModule.AppSettings",                                 callback: function(n) {                                     n.set("URL", custURL);                                     n.addReference("MyAppModule.AppSettings_Session", sessionObjs[0].getGuid());                                     mx.data.commit({                                             mxobj: n,                                             callback: function() {                                                 console.log("AppSettings Object committed");                                             },                                             error: function(t) {                                                 console.log("Error occurred attempting to commit: " + t)                                             }                                     })                                 },                                 error: function(t) {                                     console.log("an error occured: " + t)                                 }                         });
asked
1 answers
0

Hello Mohan, 

I would check if "custURL" and "sessionObjs" are valid in your context first. 

Try the following 3 lines after "n.addReference("MyAppModule.AppSettings_Session", sessionObjs[0].getGuid());" and then check your logs for the expected objects:

console.log(custURL);

console.log(sessionObjs[0]);

console.log(n.getReference("MyAppModule.AppSettings_Session");

 

answered