Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6806 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

You can perform a find using the contents of a script variable as the criteria like this:

...

Enter Find Mode []

Set Field [ field ; $my_num ]

Perform Find []

...

Posted (edited)

Try this:

Enter Find Mode []

Set Field ["MyNumberField"; $my_num]

Perform Find []

Ender beat me to it

Edited by Guest
Posted

Thanks for the quick response Ender & Breezer! This method works well for one Find, but I guess then my next question is, what happens if I want to perform a Find on 6 Script Variables? This is why I was trying for the "Find[Restore]".

For example, I have a "Tests" field in my database. A record in the database can have multiple tests performed on it. Test numbers can range from 1-100. For this little project I'm doing, I want to be able to Find records on no more than 6 tests. So, if I wanted to find records that had just 3 certain tests performed on it, I would enter criteria in only 3 of my 6 test fields - test_field1 = 1, test_field2 = 33, and test_field3 = 99. I want to get all records that have had those test numbers performed on them. How would I structure this Find?

Thanks,

J

Posted

Your structure is not very clear here. 3 criteria for 6 test fields with 100 tests?? I don't get it. And what was the script variable for again?

Perhaps you can explain what each record is and how these multiple tests fit in.

Posted

Sorry for the confusion Ender. In Browse mode, there are six fields for someone to enter in test numbers. Test numbers range from 1-100 (Test 95, Test 60 etc). The tool I'm developing lets people look for records which have had varioius test performed on them. Normally no one will ever need to perform a Find on more than a combination of 6 tests (hense six fields). So someone can look for a record that may have had (Test 4 and Test 76) only or they could perform a Find again to see if there are any records matching Test 4, and Test 10, and Test 56, and Test 70, and Test 88, and Test 90. I'm just trying to perform a find based on the criteria that the user specifies.

Since I'm in browse mode, the script variables come into play because I capture what the user enters in any of the six fields on my layout, store it, then use it my script later on.

What would be a good way to approach this problem?

Posted

No, no, with the current structure, I think a global (or set of globals,) would be needed. I'm just trying to figure out how to get the find script to work.

I'm thinking it would be better to use a separate table to record the tests (each Person can have many Tests.) And then use relationships from global search fields to the Test table. But this gets tricky as well, to avoid finds on an unstored calc.

Posted

I agree with you Ender, the structure needs to be revisited. From what I can tell, there are some redundant fields which can be resolved by using a 1:M relationship. I wouldn't be surprised if each test has been setup as it's own field, hence, TEST1, TEST2...TEST100.

QUESTION to Jasongodoy: How is your current structure set? We will need more information to effectively help you further.

Posted

OK guys, I'm so sorry for all this confusion. Here is my last question that would probably put me on the right track. How do I use Constrain Found Set properly?...

How do you perform multiple Finds on the same field (in my case, "Test_Num" field)? What I want to do is from within a script, search for records that have Test # 105. Once the Found Set for Test # 105 comes up, within that Found Set I want narrow or constrain that found set to records that contain Test # 105 and Test # 107. I tried using Constrain Found Set but with no luck. I suspect I might be setting this up wrong. I hope this is clear.

J

  • 2 months later...
Posted

I have a question along the same lines as the original question in this post. I work for a trade show decorating company. We take orders from individual exhibitors at a tradeshow event. Then we need to make reports that show how many blue tables, red chairs, etc. are ordered for each show. Currently I have hard coded report functions that either produce reports that have "all items ordered" or "all chair orders only" etc.

What I would like to do is be able to create a customizable report that a user could designate what they want in the report (i.e. a report with carpet and chairs).

My current structure has a table for inventory items (item description, taxable, etc.) and a table for invoice line items (exhibitor 1 ordered 1 blue table). In the inventory table I have a field for report type (carpet, table, chairs, etc).

I need the report to pull from the line items because I need to know the quantity and the exhibitor in the reports. What I would like is a layout where the user can choose report type from a checkbox and then a report is created based on their selections.

The hard coded reports I use now first get all related line item records (based on the trade show) and then use the constrain found set step based on report type to find only those items in the needed report type.

What I have been trying to do this morning is use the data created by a report type checklist (stored in a global field) to run the constrain found set steps. Since the checklist returns an array I am taking steps to parse the data into each individual report type using :D

Set field [showfacts::Current_report_type; LeftValues (Showfacts::G_select_report_type ; 1 )]

This leaves me with the first report type seperated out into field "current_report_type". What I wanted to do next is get this value into the find step and use it as the first find where lineitems::report type = current_report_type. I would then use a looping script to grab each selected report type one by one. Since I can't do a find where lineitems::report type = current_report_type, I tried using a variable(i.e. set variable $current_report_type = current_reporty_type and then use the variable in the find step but this didn't work. I'm not sure if it is because you can't use variables in the find step or because I wasn't getting rid of the trailing return correctly or what.

I know this probably isn't the best way to go about this but I thought I would push ahead and learn something in the process. Now I'm just feeling lost. Any suggestions are greatly appreciated as I think I'm finally past the basic concepts of FM and need to move into the more advanced techniques to improve my database.

This topic is 6806 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.