Why does this find an existing record:
var fsGoal = forms.goal_browse.foundset.duplicateFoundSet();
fsGoal.find();
fsGoal.goal_student_id = student_uid;
if(assessment_uid) {
fsGoal.goal_assessment_id = assessment_uid;
} else {
fsGoal.goal_assessment_id = "^=";
}
fsGoal.created_d = globals.UTIL_dateTimeFrom4D(aFieldStr[3-1], aFieldStr[4-1]);
recs = fsGoal.search();
… but this does not:
var fsGoal = forms.goal_browse.foundset.duplicateFoundSet();
fsGoal.find();
fsGoal.goal_student_id = student_uid;
fsGoal.goal_text = goalText
if(assessment_uid) {
fsGoal.goal_assessment_id = assessment_uid;
} else {
fsGoal.goal_assessment_id = "^=";
}
fsGoal.created_d = globals.UTIL_dateTimeFrom4D(aFieldStr[3-1], aFieldStr[4-1]);
recs = fsGoal.search();
When tested in the interactive console, the value of fsGoal.goal_text and goalText are the same,
“New annual goal [781] for Carlson, Jeffrey…”
… and when I try in the console,
(fsGoal.goal_text == goalText)
…it returns true -???
The action for the second search (in the performance data) appears as follows:
select goal_assessment_goal_id from assessment_goal where created_d = ? and goal_assessment_id = ? and goal_text between ? and ? and goal_student_id = ? and tenant_id = ? order by goal_assessment_goal_id asc limit ?
Thank you,
Don