AnsweredAssumed Answered

Multiple "And" Find Script

Question asked by NaturSalus on Aug 22, 2011
Latest reply on Aug 22, 2011 by NaturSalus

Title

Multiple "And" Find Script

Post

Hello,

I have a table named Food where I list several food characteristics.

Relevant Food table fields:

__kpFoodID

FoodName

FoodCategory

FoodSubCategory

BloodTypeASecretor

BloodTypeANonSecretor

BloodTypeBSecretor

BloodTypeBNonSecretor

BloodTypeABSecretor

BloodTypeABNonSecretor

BloodTypeOSecretor

BloodTypeONonSecretor

 

So, depending on the persons BloodType and wether he/she is Secretor or Non Secretor a particular Food can be:  Avoid (detrimental), Beneficial, Neutral.

My final objective is to have four types of food report, one for each blood type, based on the food suitability: Avoid, Beneficial, Neutral 

FOOD REPORT

BLOOD TYPE:

Avoid                              Beneficial                           Neutral

Food Category                 Food Category                    Food Category 

Food SubCategory            Food SubCategory              Food SubCategory 

FoodName                       FoodName                         FoodName  

 

So I need 4 scripts, one for each blood type, that will find and sort the records. Finally, I will associate each script to its button: A Type Food, B Type Food, AB Type Food, O Type Food.

I have a working Find and Sort script  based on just one criteria for each blood type.

So, for the A Blood Type I have the following script to find out the "Beneficial" foods:

Find_BT_A_Beneficial script is the following

Enter Find Mode [ ]
Set Field [ Food::BloodTypeASecretor; "Beneficial" ]
New Record/Request
Set Field [ Food::BloodTypeANonSecretor; "Beneficial" ]
Set Error Capture [ On ]
Perform Find [ ]
Perform Script [ “Food Record Sorting”]

 

Food Record Sorting Script:

Enter Browse Mode

Go to Layout [ “Alimentos Recomendados” (Food) ]
Sort Records [ Specified Sort Order: FoodCategory::FoodCategory; ascending FoodSubcategoy::FoodSubcategory; scending Food::FoodName; ascending ]
[ Restore; No dialog ]
Enter Preview Mode [ Pause ]
Enter Browse Mode []
Go to Layout [ original layout ]

 

I would like to be able to modif ythe Find_BT_A_Beneficial script so that it finds and sorts all the food records that are: Avoid, Beneficial & Neutral for both Blood Type A Secretors and Blood Type A NonSecretors.

Since I have tried without success some modifications, my question is:

How can I modify the Find_BT_A_Beneficial script so that the found set includes:

Foods to Avoid & Beneficial & Neutral for the Secretor Blood Type A

&

Foods to Avoid & Beneficial & Neutral for the NonSecretor Blood Type A?

 

Thanks

Outcomes