Find all the records that have Task_Status != Complete

Hi all,

I have the following method that searches for all the records that have Task_Status = Complete:

var Complete = “Complete”
controller.find();

task_status = Complete

var x = controller.search();
if (x ==0 )
{
//Nothing was found
var btn = globals.Error_MSG('No matches found for ’ + task_status, ‘Cancel’, ‘Try Again’ );
if (btn == ‘Try Again’)
{
task_status = null

//Search();
}
else
{
//they clicked cancel
controller.loadAllRecords()
}
}

I would like to reveres the search to find all the records with Task_Status that are not equal to Complete.

Thanks for any help.

Abrahim

maybe try something along these lines. This is just a concept, the syntax may need some work.

controller.find()
task_status = ‘Complete’;
controller.search();

if (0<=foundset.getSize())
{
var thePressedButton = plugins.dialogs.showQuestionDialog (‘DialogTitle’,‘Please select option.’,‘Open Tasks’,‘Try Again’,)

if (thePressedButton == ‘Open Tasks’)
{
controller.find()
task_status = ‘^’;
controller.search();
}

else if (thePressedButton == ‘Try Again’)
{
controller.find()
task_status = ‘Complete’;
controller.search();
}
}

Hope this sends you in the right direction

Dear Ebrandt,

This script work great if Im searching for Task_status == Complete, but Im trying to search for the Task_status that is not equal to Complete Task_status != Complete.

Thanks for any help,

Abrahim

this should show and tasks where this field is empty

if (thePressedButton == ‘Open Tasks’)
{
controller.find()
task_status = ‘^’; or you could do task_status != ‘Complete’;
controller.search();
}

You could also have the field defalut to ‘Incomplete’ instead of being empty, and search for “Incomplete”

We don’t have Incomplete, what we have is:

New
In_Progress
Complete
On_Hold
Help
Deleted

SO, I tried:

controller.find()
task_status != ‘Complete’;

controller.search();

if (0<=foundset.getSize())
{
//var thePressedButton = plugins.dialogs.showQuestionDialog (‘DialogTitle’,‘Please select option.’,‘Open Tasks’,‘Try Again’,)
var thePressedButton = plugins.dialogs.showQuestionDialog( ‘Result’, ‘Please select option’, ‘Open Tasks’, ‘Try Again’)

if (thePressedButton == ‘Open Tasks’)
{
controller.find()
//task_status = ‘^’;

task_status != ‘Complete’;
controller.search();
}

else if (thePressedButton == ‘Try Again’)
{
controller.find()
task_status != ‘Complete’;
controller.search();
}
}

But, it only finds one record. I know that we have more then one record with Task_Status New, In_Progress or On_Hold.

Thanks,

Abrahim

You can do:

controller.find();
task_status = "!=Complete";
controller.search();

you can have a look of the find() command in the reference guides:

= “data”

Thanks Enrico ,

That did it,

Abrahim