I am having issues trying to understand how to update values using client scripts. My plan is to update non_part_usage.user_def4 to blank if the personID is null or empty.
My understanding is that setControlValue is used to update, but I am not sure how to link the value from the array (npu_id) and setControlValue.
Client Script
var personID = getControlValue('task','person_id');
alert(personID);
if(isNullOrEmptyString(personID))
{
var task_id = getControlValue('task','task_id');
var npu_id = getDBValues('SP_COUNT_NPU',[task_id]);
for(var i=0;i<size(npu_id);++i)
{
setControlValue('non_part_usage', 'user_def4', '');
}
}
Client Script SQL
SELECT npu_id FROM NON_PART_USAGE WHERE task_id = '{0}'
A couple of questions:
- How do you update the user_def4 to blank?
- Is there a way to mass update all the values in the array?