I have a model (ESCO Product) with a condition where records are in another model (PTI). 
I want to update the source model (PTI) using Javascript, which will then affect the ‘in’ condition.
I am assuming that if I call update data on the PTI model and then call update data on the ESCO Product, the in portion will have been updated and therefore be properly updated. Here is my code (which runs on a third model : ) )
var params = arguments[0], $ = skuid.$;
var model = params.model;
var PTI = skuid.$M(‘PTI’);
var ESCO = skuid.$M(‘ESCOProduct’);
console.log(ESCO);
var adder = skuid.$M(‘Adder’);
var item = params.item;
var row = item.row;
var Id = model.getFieldValue(row,‘Id’);
var indexCondition = PTI.getConditionByName(‘Index’);
console.log(PTI);
PTI.setCondition(indexCondition,Id);
PTI.updateData({callback:function(){
adder.updateData();
ESCO.updateData();
}});
console.log(PTI);
console.log(adder);
console.log(ESCO);
$.each(PTI.data, function(coolRow){
console.log(PTI.getFieldValue(coolRow,‘ESCO_Product__c’, true));
});
I have been looking in the console, and the SOQL for the ESCO Product model seems to be the same even after updating the PTI model. Can this not be affected by code? I am also getting the following error on the loop :
Uncaught TypeError: Cannot use ‘in’ operator to search for ‘ESCO_Product__c’ in 1
I would appreciate some feedback, Thanks.
Question
in' operator bug in model condition
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.