SeedCodeHierarchy

Found Sets

SeedCodeHierarchy.FoundSets History

Hide minor edits - Show changes to output

Changed lines 19-22 from:
Note that the "Upon Opening" script of SeedCode Hierarchy sets value of $$Hy_Show to "15". You'll want to change or remove this if you import Upon Opening into your file.

Now if you use the filtering option, you'll be able to restrict which top level records show up, however in the following levels you'll see ALL the related records for each top level record. So if you filter to only show companies with active jobs, you'll see ALL jobs for each company shown unless you go further and restrict the 2nd level records as well. Instructions for doing so follow.
to:
Note that the "Set Default Contents" script of SeedCode Hierarchy sets value of $$Hy_Show to "15". You'll want to change or remove this if you import our "Upon Opening" script into your file.

Now, if you use the filtering option, you'll be able to restrict which top level records show up, however, in the following levels you'll see ALL the related records for each top level record. So if you filter to only show companies with active jobs, you'll see ALL jobs for each company shown unless you go further and restrict the 2nd level records as well. Instructions for doing so follow.
Changed lines 38-39 from:
->Though somewhat more complicated, you may find more flexibility doing this in scripts. You can edit each of the scripts that build the hierarchy so that they only see the related records you wish them to. You have to address this in two places: first, where we determine if thee are related records, and secondly when we write them to the hierarchy.
to:
->Though somewhat more complicated, you may find more flexibility doing this in scripts. You can edit each of the scripts that build the hierarchy so that they only see the related records you wish them to. You have to address this in two places: first, where we determine if there are related records, and then when we write them to the hierarchy.
Changed lines 53-54 from:
-> Next, edit the build script for the level you're restricting. In our example this is level two, so we'd edit the script "Build Hierarchy Level 2 { Open All }". You'll see a loop within this script. Right inside the loop add an If() statement that only executes the contents of the loop if the record should be shown: in our example this would be if the job is active. So our loop would now look like this:
to:
-> Next, edit the build script for the level you're restricting. In our example this is level two (where projects live), so we'd edit the script "Build Hierarchy Level 2 { Open All }". You'll see a loop within this script. Right inside the loop add an If() statement that only executes the contents of the loop if the record should be shown: in our example this would be if the job is active. So our loop would now look like this:
Changed line 56 from:
-->  If ( JobActive = 1 ) <-- This is a new line.
to:
-->  If ( JobActive = 1 ) '''<-- This is a new line.'''
Changed line 61 from:
-->  End If <-- This is a new line.
to:
-->  End If '''<-- This is a new line.'''
Changed lines 9-11 from:
You'll use the "show" attribute of the  "Build Found Set for Top Level { Show }" script to restrict the top-level records to just the ones you're interested in. The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter. The easiest way to do this is by declaring the variable in a button's script parameter as we do with the "apply filter" button in example two. Here is what it's script parameter looks like:
-> Let ( $$Hy_Show = "By Name" ; "" )

to:
You'll use the "show" attribute of the  "Build Found Set for Top Level { Show }" script to restrict the top-level records to just the ones you're interested in. The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter. The easiest way to do this is in the "Filter Hierarchy" script itseld, and you can see how we do that within the script.
Changed lines 13-18 from:
-> All -- Shows all top level records and this is the default of $$Hy_Show is empty and no script parameter is sent.

-> Any Number -- Send any number to show just that number of top level records. This is really only useful when demoing and testing the hierarchy so you can play with both large and small hierarchies.

-> Filter -- If you send "Filter" (without the quotes) in the script parameter or in $$Hy_Show then
the hierarchy will search your top level records for the contents of the field FilterGlob in the hierarchy table. You'll modify the script "Build Found Set for Top Level { Show }" so that is searches the correct field in your table (our [[integration]] notes discuss this in step 10. The script "Filter Hierarchy" we use in Example Two current sets the global variable $$Hy_FilterBy to "Name". You can branch the script "Build Found Set for Top Level { Show }" to accept other values instead of "Name" and you'll see an example already there where $$Hy_FilterBy = "Something Else."
to:
-> All -- Shows all top level records and this is the default if $$Hy_Show is empty and no script parameter is sent.

-> Any Number -- Send any number to show just that number of top level records. This is really only useful when demoing and testing the hierarchy so you can play with both large and small hierarchies. This is how we show 15 or 300 records for example.

-> Filter -- If you send "Filter" (without
the quotes) in the script parameter or in $$Hy_Show then the hierarchy will search your top level records for the contents of the field FilterGlob in the hierarchy table. You'll modify the script "Build Found Set for Top Level { Show }" so that is searches the correct field in your table (our [[integration]] notes discuss this in step 10). The script "Filter Hierarchy" we use in Example Two current sets the global variable $$Hy_FilterBy to "Name". You can branch the script "Build Found Set for Top Level { Show }" to accept other values instead of "Name" and you'll see an example already there where $$Hy_FilterBy = "Something Else."
Changed lines 7-9 from:
For example, if your top level represents Companies, you may only wish to see your companies with active projects. Of if your top level represents Products, you may only wish to see products that are in kits. In both cases you'll "filter" the hierarchy to show just the top level you want. (Example Two of SeedCode Hierarchy illustrates this kind of filtering, using the company name as an example.)

You'll use the "show" attribute of the script to restrict the top-level records to just the ones you're interested in. The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter. The easiest way to do this is by declaring the variable in a button's script parameter as we do with the "apply filter" button in example two. Here is what it's script parameter looks like:
to:
For example, if your top level represents Companies, you may only wish to see your companies with active projects. Or, if your top level represents Products, you may only wish to see products that are in kits. In both cases you'll "filter" the hierarchy to show just the top level contents you want. ([[UsingExampleTwo | Example Two]] of SeedCode Hierarchy illustrates this kind of filtering, using the company name as an example.)

You'll use the "show" attribute of the  "Build Found Set for Top Level { Show }" script to restrict the top-level records to just the ones you're interested in. The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter. The easiest way to do this is by declaring the variable in a button's script parameter as we do with the "apply filter" button in example two. Here is what it's script parameter looks like:
Changed lines 5-6 from:
However, if you have a lot of records in your top level, you may want to restrict these so you're not looking at a hierarchy that is thousands of rows long. (The hierarchy [[ limitations | supports ]] displaying up to 5,000 rows.)
to:
However, if you have a lot of records in your top level, you may want to restrict these so you're not looking at a hierarchy that is thousands of rows long. (The hierarchy [[ limitations | supports ]] displaying up to 5,000 rows, but your users probably don't want to scroll through that many.)
Changed lines 18-19 from:
-> By Name -- If you send "By Name" (without the quotes) in the script parameter or in $$Hy_Show then the hierarchy will search your top level records for the contents of the field FilterGlob in the hierarchy table. You'll modify the script "Build Found Set for Top Level { Show }" so that is searches the correct field in your table.
to:
-> Filter -- If you send "Filter" (without the quotes) in the script parameter or in $$Hy_Show then the hierarchy will search your top level records for the contents of the field FilterGlob in the hierarchy table. You'll modify the script "Build Found Set for Top Level { Show }" so that is searches the correct field in your table (our [[integration]] notes discuss this in step 10. The script "Filter Hierarchy" we use in Example Two current sets the global variable $$Hy_FilterBy to "Name". You can branch the script "Build Found Set for Top Level { Show }" to accept other values instead of "Name" and you'll see an example already there where $$Hy_FilterBy = "Something Else."
Changed lines 22-23 from:
Now if you use the filtering (By Name) option, you'll be able to restrict which top level records show up, however in the following levels you'll see ALL the related records for each top level record. So if you filter to only show companies with active jobs, you'll see ALL jobs for each company shown unless you go further and restrict the 2nd level records as well. Instructions for doing so follow.
to:
Now if you use the filtering option, you'll be able to restrict which top level records show up, however in the following levels you'll see ALL the related records for each top level record. So if you filter to only show companies with active jobs, you'll see ALL jobs for each company shown unless you go further and restrict the 2nd level records as well. Instructions for doing so follow.
Changed lines 35-36 from:
->(where CommonOne is a calc equal to 1 and JobActive is a number field containing a 1 when the job is active.) The only disadvantage to this method is that you'll always see only active jobs unless you make the "active" part of the relationship based on a global field so you can see All jobs in some cases and only active jobs in others.
to:
->(where CommonOne is a calc equal to 1 and JobActive is a number field containing a 1 when the job is active.) The only disadvantage to this method is that you'll '''always''' see just the active jobs, since the relationship can't be changed on the fly. (Unless you use a relationship whose contents ''can'' be changed on the fly.)
Added lines 22-23:
Now if you use the filtering (By Name) option, you'll be able to restrict which top level records show up, however in the following levels you'll see ALL the related records for each top level record. So if you filter to only show companies with active jobs, you'll see ALL jobs for each company shown unless you go further and restrict the 2nd level records as well. Instructions for doing so follow.
Changed line 55 from:
-->  If ( JobActive = 1 )
to:
-->  If ( JobActive = 1 ) <-- This is a new line.
Changed line 60 from:
-->  End If
to:
-->  End If <-- This is a new line.
Changed lines 54-56 from:
-->[= Loop =]
-->[=  If ( JobActive = 1 ) =]
-->[=    #Record the ID of the Level 2 Record =]
to:
--> Loop
-->  If ( JobActive = 1 )
-->    #Record the ID of the Level 2 Record
Changed lines 54-63 from:
-->- Loop
-->-  If ( JobActive = 1 )
-->-    #Record the ID of the Level 2 Record
-->-    < script continues >
-->-    End If
-->-    #
-->-  End If
-->-  Go to Record/Request/Page [Next; Exit after last]
-->- End Loop
to:
-->[= Loop =]
-->[=  If ( JobActive = 1 ) =]
-->[=    #Record the ID of the Level 2 Record =]
-->    < script continues >
-->    End If
-->    #
-->  End If
-->  Go to Record/Request/Page [Next; Exit after last]
--> End Loop
Changed lines 54-63 from:
-->Loop
-->  If ( JobActive = 1 )
-->    #Record the ID of the Level 2 Record
-->    < script continues >
-->    End If
-->    #
-->  End If
-->  Go to Record/Request/Page [Next; Exit after last]
--> End Loop
to:
-->- Loop
-->-  If ( JobActive = 1 )
-->-    #Record the ID of the Level 2 Record
-->-    < script continues >
-->-    End If
-->-    #
-->-  End If
-->-  Go to Record/Request/Page [Next; Exit after last]
-->- End Loop
Changed lines 55-59 from:
----> If ( JobActive = 1 )
-----> < script continues >
----->
#
----> End If
---> Go to Record/Request/Page [Next; Exit after last]
to:
-->   If ( JobActive = 1 )
-->     #Record the ID of the Level 2 Record
-->     < script continues >
-->    End If
-->    #
-->  End If
--> 
Go to Record/Request/Page [Next; Exit after last]
Changed lines 39-40 from:
->Begin by editing the script Build Hierarchy Level 1. You'll see a comment which begins "Is there a child of this Record?..." You'll need to change the following SetVariable line so that it only returns a 1 if there are related records you wish to see (as opposed to any related records, which is how it works now.) Following our example of "active" jobs, you might change the SetVariable calculation to this...
to:
->Begin by editing the script "Build Hierarchy Level 1". You'll see a comment which begins "Is there a child of this Record?..." You'll need to change the following SetVariable line so that it only returns a 1 if there are related records you wish to see (as opposed to any related records, which is how it works now.) Following our example of "active" jobs, you might change the SetVariable calculation to this...
Changed lines 43-45 from:
->...which would return a 1 if there are any active jobs for that company. You'll need to change this for each of the levels you wish to restrict on this way.

-> Next, edit the script
.
to:
->...which would return a 1 if there are any active jobs for that company. You'll need to change this for each of the levels you wish to restrict on this way. And note that you can branch this calculation to look at a global field or global variable for instructions. For example, you may have a global variable that says "all" or "active", meaning which kinds of jobs to show. In that case your calc would look like this:

--> Case (
--> $$ShowJobs = "all" ;
---> Not IsEmpty ( Evaluate ( "HierarchyDataLevel2::" & $$Hy_IDFieldNameLevel2 ) ) ;
--> $$ShowJobs = "active" ;
---> Not isEmpty ( List ( HierarchyDataLevel2::JobActive ) )
--> )

-> Next, edit the build script for the level you're restricting. In our example this is level two, so we'd edit the script "Build Hierarchy Level 2 { Open All }". You'll see a loop within this script. Right inside the loop add an If() statement that only executes the contents of the loop if the record should be shown: in our example this would be if the job is active. So our loop would now look like this:

-->Loop
----> If ( JobActive = 1 )
-----> < script continues >
-----> #
----> End If
---> Go to Record/Request/Page [Next; Exit after last]
--> End Loop

-> Note that we put the new End If before the Go to Record Request step. That's it
.
Changed lines 37-45 from:
Though somewhat more complicated, you may find more flexibility doing this in scripts.
to:
->Though somewhat more complicated, you may find more flexibility doing this in scripts. You can edit each of the scripts that build the hierarchy so that they only see the related records you wish them to. You have to address this in two places: first, where we determine if thee are related records, and secondly when we write them to the hierarchy.

->Begin by editing the script Build Hierarchy Level 1. You'll see a comment which begins "Is there a child of this Record?..." You'll need to change the following SetVariable line so that it only returns a 1 if there are related records you wish to see (as opposed to any related records, which is how it works now.) Following our example of "active" jobs, you might change the SetVariable calculation to this...

--> Not isEmpty ( List ( HierarchyDataLevel2::JobActive ) )

->...which would return a 1 if there are any active jobs for that company. You'll need to change this for each of the levels you wish to restrict on this way.

-> Next, edit the script
.
Added lines 36-37:

Though somewhat more complicated, you may find more flexibility doing this in scripts.
Changed lines 33-34 from:
-->(where CommonOne is a calc equal to 1 and JobActive is a number field containing a 1 when the job is active.) The only disadvantage to this method is that you'll always see only active jobs unless you make the "active" part of the relationship based on a global field so you can see All jobs in some cases and only active jobs in others.
to:
->(where CommonOne is a calc equal to 1 and JobActive is a number field containing a 1 when the job is active.) The only disadvantage to this method is that you'll always see only active jobs unless you make the "active" part of the relationship based on a global field so you can see All jobs in some cases and only active jobs in others.
Changed lines 22-24 from:
!! How can I restrict which 2nd and 3rd level record show up. What if I only want to see *active* jobs for my companies, when companies are the top level?

Th
to:
!! How can I restrict which 2nd and 3rd level record show up? What if I only want to see *active* jobs for my companies, when companies are the top level?

You have two options for filtering records other that the top level records.

In Relationships.

-> You can edit the Hierarchy Data relationships (the ones between HierarchyDataLevel1 and HierarchyDataLevel2, etc.) so that instead of showing all related records they only show some related records. For example, if level 1 were Companies and level 2 were Jobs, you could edit the relationship between HierarchyDataLevel1 and HierarchyDataLevel2 so that the relationship were only true for a company's *active* jobs, something like this:

--> CompanyID_kprime    =    JobsCompanyID_kf
-->CommonOne            =    JobActive 

-->(where CommonOne is a calc equal to 1 and JobActive is a number field containing a 1 when the job is active.) The only disadvantage to this method is that you'll always see only active jobs unless you make the "active" part of the relationship based on a global field so you can see All jobs in some cases and only active jobs in others.

In Scripts.
Changed lines 20-24 from:
Note that the "Upon Opening" script of SeedCode Hierarchy sets value of $$Hy_Show to "15". You'll want to change or remove this if you import Upon Opening into your file.
to:
Note that the "Upon Opening" script of SeedCode Hierarchy sets value of $$Hy_Show to "15". You'll want to change or remove this if you import Upon Opening into your file.

!! How can I restrict which 2nd and 3rd level record show up. What if I only want to see *active* jobs for my companies, when companies are the top level?

Th
Changed lines 5-6 from:
However, if you have a lot of records in your top level, you may want to restrict these so you're not looking at a hierarchy that is thousands of rows long. (The hierarchy [[ limitations | supports ]] displaying up to 5000 rows.)
to:
However, if you have a lot of records in your top level, you may want to restrict these so you're not looking at a hierarchy that is thousands of rows long. (The hierarchy [[ limitations | supports ]] displaying up to 5,000 rows.)
Deleted line 9:
Changed lines 9-10 from:
You'll use the "show" attribute of the script to restrict the top-level records to just the ones you're interested in. The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter.
to:
You'll use the "show" attribute of the script to restrict the top-level records to just the ones you're interested in. The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter. The easiest way to do this is by declaring the variable in a button's script parameter as we do with the "apply filter" button in example two. Here is what it's script parameter looks like:

-> Let ( $$Hy_Show = "By Name" ; "" )

Changed lines 17-19 from:
-> By Name -- If you send "By Name" (without the quotes) in the script parameter or in $$Hy_Show then the hierarchy will search your top level records for the contents of the field FilterGlob in the hierarchy table. You'll modify the script "Build Found Set for Top Level { Show }" so that is searches the correct field in your table.
to:
-> By Name -- If you send "By Name" (without the quotes) in the script parameter or in $$Hy_Show then the hierarchy will search your top level records for the contents of the field FilterGlob in the hierarchy table. You'll modify the script "Build Found Set for Top Level { Show }" so that is searches the correct field in your table.

Note that the "Upon Opening" script of SeedCode Hierarchy sets value of $$Hy_Show to "15". You'll want to change or remove this if you import Upon Opening into your file.
Changed lines 9-17 from:
You'll use the "show" attribute of the script to restrict the top-level records to just the ones you're interested in. The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter.
to:
You'll use the "show" attribute of the script to restrict the top-level records to just the ones you're interested in. The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter.

While you can expand upon this, the following are the currently accepted values for "Show":

-> All -- Shows all top level records and this is the default of $$Hy_Show is empty and no script parameter is sent.

-> Any Number -- Send any number to show just that number of top level records. This is really only useful when demoing and testing the hierarchy so you can play with both large and small hierarchies.

-> By Name -- If you send "By Name" (without the quotes) in the script parameter or in $$Hy_Show then the hierarchy will search your top level records for the contents of the field FilterGlob in the hierarchy table. You'll modify the script "Build Found Set for Top Level { Show }" so that is searches the correct field in your table
.
Changed lines 7-9 from:
The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter.
to:
For example, if your top level represents Companies, you may only wish to see your companies with active projects. Of if your top level represents Products, you may only wish to see products that are in kits. In both cases you'll "filter" the hierarchy to show just the top level you want. (Example Two of SeedCode Hierarchy illustrates this kind of filtering, using the company name as an example.)

You'll use the "show" attribute of the script to restrict the top-level records to just the ones you're interested in.
The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter.
Added lines 1-7:
!! How Does the Hierarchy Determine Which Top-Level Records to Show?

The script "Build Found Set for Top Level { Show }" controls which top level records show up in the hierarchy. This script basically performs a "Find" in your Level 1 table and uses the found set of records as the top level. The script determines which records to show based on a script parameter called "Show". Sometimes you'll probably want to find All your top level records which is the default and you can just leave "Show" blank and call the script "Build Found Set for Top Level { Show }" without doing anything else.

However, if you have a lot of records in your top level, you may want to restrict these so you're not looking at a hierarchy that is thousands of rows long. (The hierarchy [[ limitations | supports ]] displaying up to 5000 rows.)

The parameter "show" can be sent to the script as a script parameter, but you'll most often "send it" by setting a global variable called "$$Hy_Show" (without the quotes) to the same value as you'd send the script parameter.
(855) SEEDCODE
[email protected]
Follow us: