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

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

Recommended Posts

Posted

Hey everyone!

Here's the scoop. I'm re-writting the databases here at work...and I'm wanting to create a button that takes them to a list view or a form view...simple enough...but here's the catch. If they are in a LIST view already...I want the button to be FORM view button...and vise versa with just ONE button. So that if they are looking at a list view and want to go back to the form view they can just click that button and it takes them there. That the button changes to list or form view pending on which view they are currently in.

Is that possible...and if so...how do I write or do that?

Thanks for all your help!

Jami

Posted

let's say your form view is layout #1 and name is form view. and list view is layout # 2 and name is list view.

if( status(currentlayoutnum)=1 or status(currentlayoutname)

= "form view")

go to layout [ list view ]

else

go to layout [ form view ]

end if

HTH...

kyle

Posted

To complete Kyle's answer, you should also change the label from "list view" to "form view", either with container global field or simple text global field.

Let's say your label is a global g_modeview using text and Kyle's script

if( status(currentlayoutnum)=1 or status(currentlayoutname)

= "form view")

go to layout [ list view ]

setfield (g_modeview, "form view")

else

go to layout [ form view ]

setfield (g_modeview, "list view")

end if

Posted

That definately helps out in a big way! the only problem is now I have to go and attatch that script to all of the databases!

Thanks for your help!

Jami

Posted

Ok one addition to this.

What is the correct syntax for this example:

Let's say that I'm in a List view no matter what layout I'm in...and I want to change that layout to a table view.

What would that be?

something like:

status(currentviewname)="form"

go to "TableView"

I just don't get the syntax on how to make this work...but basically if I'm in a FORM view and want to change to a table view, I just have to click that button, and if I'm in a table view the same button will take me back to a form view.

Posted

First, in Layout mode, open Layout Setup, click on the "Views" tab, and click on the "Properties" button next to Table view. You'll need to show the Header in order to be able to see any buttons (which must be in the Header).

Next, the correct syntax is: Status(CurrentView) = 0

In this function, 0 means Form, 1 means List and 2 means Table. So:

Create a calc field that we'll use as a button (two, actually). Have the calc for the first one be:

Case(Status(CurrentView) = 0, "List", Status(CurrentView) = 1, "Table", "Form")

For the second calc field:

Case(Status(CurrentView) = 0, "Table", Status(CurrentView) = 1, "Form", "List")

Make both calculations unstored.

This has the buttons change as the View changes.

Now create a script which we'll attach to the first field:

If(Status(CurrentView) = 0)

View As

Else

If(Status(CurrentView) = 1)

View As [Table]

Else

View As [Form]

End If

End If

I'll let you figure out the script for the second button.

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