I’m trying requery a model and compile all the data into a few tables. I’m finding, however, that my model’s condition isn’t being updated correctly. Here’s my code:
----------------------------------------------------------------------------------------------------
var interviewerSet = new Set();<br /><br />// get list of all reviewers $.each(scoreModelInit.data, function(i, row) { interviewerSet.add(row.Interviewer_Override__c); }); // create Score_Object for each record interviewerSet.forEach(function(interviewerId) { console.log(interviewerId); scoreModelFinal.setCondition(conditionName, interviewerId); console.log(scoreModelFinal.conditions;1]); // this output remains the same $.when(scoreModelFinal.updateData()).then(function() { scoreList.push(new Score_Object().CreateObject(scoreModelFinal.data)); }); });<br />
----------------------------------------------------------------------------------------------------
So I’m iterating through this set and using the values to set my condition and requery, but the condition is always stuck on the last value I give it.
Here are some of the logs I’m getting:
interviewerId : 0038000000YJgmYAAT scoreModelFinal.conditions;1] : { encloseValueInQuotes: true field:"Interviewer_Override__c" fieldTargetObjects:"Contact" inactive:false label:"" name:"Interviewer_Override__c" noValueBehavior:"deactivate" operator:"=" originalInactive:false originalValue:"" row:0 state:"filterableon" type:"fieldvalue" value:"00380000012V8SjAAK" <== THIS VALUE SHOULD BE 0038000000YJgmYAAT values:undefined }<br />
The condition stays at 00380000012V8SjAAK, even though this is the last value I’m passing in! Any advice on how to get these model query calls to execute?
Thanks!
Eulogio