Jump to content

Navigating to Layout via the layoutname


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

Recommended Posts

Is there a way to navigate to a Layout via a field that contains the layout name not the layout number. Right now I have a calculation set up to determine if field = "Ladder" then 5, if the Ladder layout is the fifth in the layout order, then I gotolayout via the field the layout number field. Can I do it without the coversion calculation or do I need a plugin or am I just wishfull thinking.

Thanks

Brian

Link to comment
Share on other sites

Kurt,

I have 124 different layouts that I want to access from one field and one script. Its a page ladder for a yearbook and the school will enter what page layout they want on a certain page and the sript takes them to that layout and record number. I.E. if the customer wants Page Layout 224 on page 55 they would type in 224 in a layout field and then click a button. This would take them to record 55 and layout 33 wich is named Layout_224. I have already set up a field that converts whatever is in the layout field to Layout_224 or whatever number they type in, I would like a script that would go to a layout based on the contents of this field i.e the layout name.

Thanks for your help,

Brian

Link to comment
Share on other sites

Hi Brian,

I can show you the way, you need to finetune it ...

You can calc the number by its name like this:

Step1: Set Field[ gAll_Layouts, LayoutNames( "Your_DB")]

By this you have all your layouts in the global field gAll_Layouts. They are separeted by CR's.

Step2: If [ PatternCount( gAll_Layouts; "Layout_Name") > 0]

......

End If

Here I check to see if the "Layout_Name" exist. "Layout_Name" can also be a field holding the Layout_Name.

Step3: (inside the previous IF ...)

Set Field[ gLayoutNumber, PatternCount( Left( gAll_Layouts; Position( gAll_Layouts; "Layout_Name"; 1; 1) - 1); "CR") +1]

With "CR" i mean 'carriage return' (sorry, but from FM windows we can't paste into this forum)

So, we actualy count the "CR's" between the layoutnames up to our needed layoutname. The layoutnumber is in fact 1 higher.

Step 4: Go to Layout[ gLayoutNumber]

It's tested and it works ...

Greetings from Belgium,

Erwin

Link to comment
Share on other sites

This topic is 7384 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
 Share

×
×
  • Create New...

Important Information

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