Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script for conditional Layout Use

Featured Replies

So, I'm trying to use a script that triggers a printable layout... But I want to use a different layout depending on the input of an "identity" in a field (One layout is in Spanish and one is in English).

Field name for Identity: "Identity"

So: If "Identity 1"; use Layout1

: If "Identity 2"; use Layout2

But I'm having some problems with the 12th Line.

I have attached a picture of the script. Sorry, I was too lazy to type it out.

Thanks for any help

Picture_2.png

After you GTRR,

If( Identity = 1)

     Go to layout1

       Else

     Go to layout2

 End If

Is there more to it than that?

  • Author

How is this supposed to look then?


Go to Related Records

If( Identity = 1)

     Go to layout1

       Else

     Go to layout2

 End If 

Perform Script ["Sort and......"]

And then continue with the rest of the script?

Edited by Guest

Yes, I presume both layouts are based on the same Table Occurrence, so your sorting scripts should work on both layouts.

  • Author

Let me give it a shot.

Thanks Fitch, I appreciate the help

  • Author

Hey Fitch,

Just wanted to let you know I finally got the script to work. I had to tinker around with it a little bit but I finally got it to work with your help.

I had some external layouts coming into play so I had to repeat the Go To Related Records twice within the If/Else statements.

It looked like this


If 
Go to Related Record [show only related records; From table: "QuoteLineItems"; Using Layout "Quotation 1" (QuoteLineItems)] Else Go to Related Record [show only related records; From table: "QuoteLineItems"; Using Layout "Quotation 2" (QuoteLineItems)] End if

Once again, thanks for your help!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.