Multiple Find Request

I have a search form with several global fields.

I created a method to go to a different form, enter find mode, copy the global values into the correct table fields, perform a search.

The problem I am having is that some of the fields need to have wildcards surounding the global values. The problem was that if there was no value in the global that needed wild cards, %% would be entered into the table field and included in the search criteria (Not What I Want).

I then created an if statement that would not copy the global field into the table field if the field was empty. This works fine, but if there is an entry in a global field that requires wild cards, nothing is copied into the table field.

I have search all through the documentation, and ave seen multiple search refferences, but to instructions.

I could use some help if anyone can understand what I am tring to accomplish.

Here is my method:

application.closeFormDialog()
forms.EquipManagerInventoryStatusListing.controller.find()
forms.EquipManagerInventoryStatusListing.equipmentinventoryid = globals.Number1
forms.EquipManagerInventoryStatusListing.tse_number = globals.Text1
// add sales po number line items search stuff global text2
forms.EquipManagerInventoryStatusListing.inventory_type = globals.Text3
forms.EquipManagerInventoryStatusListing.classification = globals.Text4
forms.EquipManagerInventoryStatusListing.sub_classification = globals.Text5
forms.EquipManagerInventoryStatusListing.availablity_status = globals.Text6
forms.EquipManagerInventoryStatusListing.service_status = globals.Text7
if (globals.Text8 == ‘!^’)
{
forms.EquipManagerInventoryStatusListing.location = ‘%’ + globals.Text8 + ‘%’
}
if (globals.Text9 == “!^”)
{
forms.EquipManagerInventoryStatusListing.manufacturer = ‘%’ + globals.Text9 + ‘%’
}
if (globals.Text10 == “!^”)
{
forms.EquipManagerInventoryStatusListing.model = ‘%’ + globals.Text10 + ‘%’
}
if (globals.Text11 == “!^”)
{
forms.EquipManagerInventoryStatusListing.serial_number = ‘%’ + globals.Text11 + ‘%’
}
if (globals.Text12 == “!^”)
{
forms.EquipManagerInventoryStatusListing.spec_it_diameter = ‘%’ + globals.Text12 + ‘%’
}
if (globals.Text13 == “!^”)
{
forms.EquipManagerInventoryStatusListing.spec_channel_diameter = ‘%’ + globals.Text13 + ‘%’
}
if (globals.Text14 == “!^”)
{
forms.EquipManagerInventoryStatusListing.spec_fov = ‘%’ + globals.Text14 + ‘%’
}
if (globals.Text15 == “!^”)
{
forms.EquipManagerInventoryStatusListing.spec_length = ‘%’ + globals.Text15 + ‘%’
}
if (globals.Text16 == “!^”)
{
forms.EquipManagerInventoryStatusListing.spec_degree = ‘%’ + globals.Text16 + ‘%’
}
// forms.EquipManagerInventoryStatusListing.controller.search(true,false);
globals.Number2 = databaseManager.getFoundSetCount(foundset);

When you do this if (variable) { blabla

You do a check for data not being NULL, not being ‘’ and not being 0.

The below should work…

application.closeFormDialog() 
forms.EquipManagerInventoryStatusListing.controller.find() 
forms.EquipManagerInventoryStatusListing.equipmentinventoryid = globals.Number1 
forms.EquipManagerInventoryStatusListing.tse_number = globals.Text1 
// add sales po number line items search stuff global text2 
forms.EquipManagerInventoryStatusListing.inventory_type = globals.Text3 
forms.EquipManagerInventoryStatusListing.classification = globals.Text4 
forms.EquipManagerInventoryStatusListing.sub_classification = globals.Text5 
forms.EquipManagerInventoryStatusListing.availablity_status = globals.Text6 
forms.EquipManagerInventoryStatusListing.service_status = globals.Text7 
if (globals.Text8) { 
forms.EquipManagerInventoryStatusListing.location = '%' + globals.Text8 + '%' 
} 
if (globals.Text9) { 
forms.EquipManagerInventoryStatusListing.manufacturer = '%' + globals.Text9 + '%' 
} 
if (globals.Text10) { 
forms.EquipManagerInventoryStatusListing.model = '%' + globals.Text10 + '%' 
} 
if (globals.Text11) { 
forms.EquipManagerInventoryStatusListing.serial_number = '%' + globals.Text11 + '%' 
} 
if (globals.Text12) { 
forms.EquipManagerInventoryStatusListing.spec_it_diameter = '%' + globals.Text12 + '%' 
} 
if (globals.Text13) { 
forms.EquipManagerInventoryStatusListing.spec_channel_diameter = '%' + globals.Text13 + '%' 
} 
if (globals.Text14) { 
forms.EquipManagerInventoryStatusListing.spec_fov = '%' + globals.Text14 + '%' 
} 
if (globals.Text15) { 
forms.EquipManagerInventoryStatusListing.spec_length = '%' + globals.Text15 + '%' 
} 
if (globals.Text16) { 
forms.EquipManagerInventoryStatusListing.spec_degree = '%' + globals.Text16 + '%' 
} 
// forms.EquipManagerInventoryStatusListing.controller.search(true,false); 
globals.Number2 = databaseManager.getFoundSetCount(foundset);

Excellent!

Thank you so much kind sir.