Jump to content
Server Maintenance This Week. ×

How do I script select a range of records to populate a checkbox field?


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

Recommended Posts

Hi,

I want to create a Dropdown List of numeric options to select a range of records.  For example, the Dropdown list would contain:

5

10

20

50

100

-------

edit...

Each option would select the next 5;10;20;50 or 100 records to the right.  A Checkbox would be populated (with an X) in the selected number of contiguous records; Then, a Find Selected Checkboxes would return the selected records.  The contiguous selection should be independent of whatever the current state of Found (Sorted/Unsorted) is.

Any help will be gratefully acknowledged.

Best,

Daniel

 

Link to comment
Share on other sites

For example, I have 1000 Records within the database. I am going to import 50 pdf files into Records 600, 601, 602, 603... 649.  I need to select from 600 to 649 prior to importing the pdf files, otherwise the pdfs will populate Records 1, 2, 3, 4... 50.

Currently I have a Checkbox which I manually select fifty times. Then I perform a Find on those selected checkboxes to filter the results from 1000 to 50.

Hope this makes more sense.

Best,

Daniel

Edited by Quito
Miscalculation
Link to comment
Share on other sites

Are your records numbered with serial numbers? If yes, then in order to find 50 records starting from record #600, you need to input somehow two values: 600 and 50 (say into two global fields). Then your script (surely you would want to script this), can find records with serial numbers in the range between 600 and 649 (the latter calculated from the two supplied numbers). No checkboxes are required for this.

If they are not numbered, then I guess (!) you would want to start by showing all records, then omit the first 599 records, then go to record number 51 and omit the remaining records. No checkboxes are required for this either.

 

Edited by comment
Link to comment
Share on other sites

Thanks, I guess you mean (See screenshot).  OK, so I would need to create two global fields for the script.  Could you please elaborate a little bit further on how the script should look like?

 

Screen Shot 2017-05-23 at 19.13.29.png

Edited by Quito
Wasn't recalculating
Link to comment
Share on other sites

I see no need to tag the records.  What you want is a found set of only the records you want to import into, correct?  The first set of numbers is the record number which is used to isolate the records and the second is the serial which happens to be same as record number but doesn't matter at all.

Edited by LaRetta
Link to comment
Share on other sites

Thanks @comment.  I do have serial numbers for the Records.  Honestly, both solutions seem viable.  The second one seems quicker to flesh out.  It seems the checkboxes will end up becoming just a visual aid. 

And, thank you @LaRetta.  I played a bit with your example and it seems to be exactly what I need.

I'll post again in a while with my solution, if other than yours.

Thanks again.

Link to comment
Share on other sites

3 minutes ago, Quito said:

It seems the checkboxes will end up becoming just a visual aid. 

I wouldn't mark the records if you can help it.  You will end up with only those records so why mark them anyway?  Do you have another reason to wanting them marked?

Link to comment
Share on other sites

I don't really see what role the checkboxes are supposed to play here. But to answer what I think may be your original question:

Suppose you have a value list named "MyValueList" containing 1000 values. And suppose you have a field named MyCheckBoxfield, formatted as checkboxes using the MyValueList value list.

In this situation, the following script step:

Set Field [ MyTable::MyCheckBoxfield ; MiddleValues ( ValueListItems ( "" ; "MyValueList" ) ; 600 ; 50 ) ]

would check 50 contiguous boxes in the MyCheckBoxfield, starting from box #600. 

 

Edited by comment
Link to comment
Share on other sites

On 5/23/2017 at 7:39 PM, comment said:

I don't really see what role the checkboxes are supposed to play here. But to answer what I think may be your original question:

Suppose you have a value list named "MyValueList" containing 1000 values. And suppose you have a field named MyCheckBoxfield, formatted as checkboxes using the MyValueList value list.

In this situation, the following script step:


Set Field [ MyTable::MyCheckBoxfield ; MiddleValues ( ValueListItems ( "" ; "MyValueList" ) ; 600 ; 50 ) ]

would check 50 contiguous boxes in the MyCheckBoxfield, starting from box #600. 

 

I tested this and got a "The specified field cannot be found".  "Set Field" was highlighted.  *Sigh*

Screen Shot 2017-05-31 at 15.10.21.png

Link to comment
Share on other sites

You must replace the table/field names with YOUR table/field names (easy to select them from drop-down).  Also be sure to match YOUR value list name precisely.

Link to comment
Share on other sites

  • 2 months later...
On 5/23/2017 at 7:16 PM, LaRetta said:

I had just finished an example.  See if this gets you closer to what you want.  It appears this is similar to Comment's suggestion.  

 

 

Select#numRecords.fmp12

Hi LaRetta,

This is perfect, it works great!  Sorry it took so long for my response but I had to read a lot in order to grok your solution.

Thank you and all the very best,

Daniel

Link to comment
Share on other sites

This topic is 2459 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.