Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling through multiple layouts

Status
Not open for further replies.

dcgentz

Technical User
May 28, 2002
1
US
I am currently setting an invoicing system for our company and one of our goals is to have a summary of all our customer activity (showing all quotes, packing slips, invoices, etc. in a single column of a single portal). I was able to achieve this using multiple layouts in one database. We also want to be able to click on an invoice #, go to the related layout and then scroll through all layouts if desired, without going back and forth to the portal. I can get to the related layout, but can only scroll through that particular layout. (ie. I can get to an invoice layout, but can't scroll through and see packing slips and quotes also. Just the invoice layouts.) Any help would be greatly appreciated.
 
Here's an option for you - duplicate your invoice layout and add buttons that will take you to duplicated layouts of the packing slip, quotes, etc...

The other nice thing about duplicating it will be that you can lock the whole thing up so all anyone can do is look. Give them a print option or whatever. Just create a copy of all the layouts and tell your script to use the duplicated layout instead of the original.

HTH
Im Steven B
 
That's an interesting problem.

How can I put that in words.....

First, you can hard-code a script that goes like:

If["Status (CurrentLayoutName) = "Data1"]
Go to Layout ["Data2"]
End If
If["Status (CurrentLayoutName) = "Data2"]
Go to Layout ["Data3"]
End If
If["Status (CurrentLayoutName) = "Data3"]
Go to Layout ["Data1"]
End If

That would work fine and you could script the reverse order too. Then you could place buttons on the layout to go to next and previous layouts, just like Steven said.

On the other hand it could be smarter to use a calculated field to specify the next layout number and script the process to go to the next layout. However, this brings up the possibility of the user scrolling to a layout that is not a data layout. So let's assume that all those non-data layouts are named beginning with a "-" eg. -PrintList.

You need a new field - a calculation field with a number result I will call layoutNext.cn:

= Status (CurrentLayoutNumber) + 1

The script to scroll forward through the layouts is:

If["layoutNext.cn > Status(CurrentLayoutCount)"]
Go to Layout ["true"]
Else
Go to Layout ["layoutNext.cn"]
End If
If [Left(Status(CurrentLayoutName), 1) = "-"]
Perform Script [Sub-scripts, "Scroll Layout Fwd"]
End If

To explain:
1. The first If statement tests if the currrent layout + 1 is more than the number of layouts that exist - if so, then go to the first layout (I have a field called true in my file that is a calculation with result = 1); if not, then go to the next layout number (defined by the field layoutNext.cn).
2. Second, when you get to that layout, the last If statement tests if the name of the layout begins with a - (i.e. it is a non-data layout as explained above). If so, it runs the whole script again. This would keep happening until it finds a layout that doesn't start with a - so make sure you have one!

And that's it. You could script the reverse using another calculated number field = Status (CurrentLayoutNumber) - 1.

Keep on FileMaking and credit to HD.

HTH

JW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top