I am trying to access the list data in the ‘task’ list on the ‘My Tasks Today’ page on the Tech Portal. I have tried:
var listData=getFormDataLists('task'); var listLength=listData.length; alert(listLength);
But this just returns 0, when there are tasks there?
What i am trying to do is retrieve the tasks, then cycle through them and then performing a dirty read on a checkbox i have added (user_def2), any that are checked will then be updated.
Best answer by Saranga Amaraweera
Hi Martin,
Hope that you are trying to retrieve values from the search result set? Have you tried this way to get the number of active tasks once the tasks are loaded?
var rows = getSearchResultDataTableRows();
alert(rows .length);
for (var rowIndex = 0; rowIndex < size(rows); ++rowIndex) { var row = rows[rowIndex];
var status=row.data['task.user_def2']; if(status=='Y')
Hope that you are trying to retrieve values from the search result set? Have you tried this way to get the number of active tasks once the tasks are loaded?
var rows = getSearchResultDataTableRows();
alert(rows .length);
for (var rowIndex = 0; rowIndex < size(rows); ++rowIndex) { var row = rows[rowIndex];
var status=row.data['task.user_def2']; if(status=='Y')
I have used the above code and it does what I need in terms of reading the list items. Now I am trying to update them. It is a list of tasks which I want to set the status to complete in bulk. I can get the value to change on the form but not commit to the db. Here is the code I have been trying with (you can see from the comments the various attempts) Any idea how to get this working? This is being run in the TechPortal
var rows = getSearchResultDataTableRows(); var noTasksToComplete=0;
if(confirm(getMessage('BULK_COMPLETE_CONFIRM','Information'))) { for (var rowIndex = 0; rowIndex < size(rows); ++rowIndex) { var row = rows[rowIndex];
var status=row.data['task.user_def2']; if(status=='Y')
//setDBValue("update task set task_status='COMPLETED' where task.taskid={0}",taskId); //setDBValue("update task set task_status='COMPLETED' where task.taskid="+taskId);