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

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

Recommended Posts

Posted

Hello All,

I don't seem to be able to find out why a script that I have created to change from one layout to another doesn't work.

I have 3 different layouts for 3 different products that I sell. If I create a new record I have created a script that upon clicking the button "new record" it asks me if I want product one, two or three. After selection a field called "BOOKING TYPE" sets itself to product 1,2,or 3 which triggers another script that changes the layout accordingly.

So far so good, but now I want my buttons "next record" and "previous record" do a similar thing: lookup field "BOOKING TYPE" and if it is set to value Product 1, Product 2 or Product 3, the layout should change accordingly.

Here's the script:

Go to Record / Request / Page [Previous]

If [bOOKINGTYPE = "product one"]

Go to Layout [product one layout]

Else If [bOOKINGTYPE = "product two"]

Go to Layout [product two layout]

Else If [bOOKINGTYPE = "product three"]

Go to Layout [product three layout]

End If

It doesn't work and I can't figure out why...has anyone got a suggestion?

Thank you in advnace,

Andy

Posted

Hi Andy,

I am not sure why you are 'going to the previous record' ... what if you are on the first record? Anyway, you can handle the Go To Layout () within one test instead of several as:

Go to Layout [ by calculation ]

... and calculation would be:

Case (

BOOKINGTYPE = "product one" ; "name of your produce one layout" ;

BOOKINGTYPE = "product two" ; "name of your produce two layout" ;

BOOKINGTYPE = "product three " ; "name of your produce three layout"

)

... also, if you name your layouts the same as the BOOKINGTYPE field itself, the calculation can be simply:

Go to Layout [ by calculation ; ... and just insert your BOOKINGTYPE field ]

Posted

Hi LaRetta,

thanks for the quick answer. Well, if I'm on the first record then I know that and I also know I can't jump beyond that record. But I usually need to do a lot of "go to previous" and "go to next" record switching and that's why the button "go to previous".

The go to layout by calc worked and I also found another error in my layouts but I got it fixed now.

Thanks again,

Andy

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