Jump 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.

3 layout invoice automated countery if script

Featured Replies

  • Newbies

Helllo,

I have to adjust current printing script. So that, based on country --> a different Invoice layout gets selected by the print invoice script.

This to meet EU vat regulations... Different informations has to be present for costumes/tax authorities = different layouts

my Idea:

Based on companies country input in the records I can have the script make an IF script...

Example:

1. if Companies::Country = "The Netherlands"

= Layout 1

2.if Companies::Country = "Belgium or France or Germany... Or (inside EU) "

= Layout 2

3.if Companies::Country = "other country OR lists"

= Layout 3

4. If... Not recognized = Please adjust country name error message

Please see the current Print Script.. in attachment.

Could someone help me to get the proper if script adjustment.

Thanks in advance

AM10_Invoice Print script.pdf

It sounds like you've got roughly the right idea already. Looking at your script, I just have some structural suggestions. This script looks to me like it ought to be 2 scripts: one script that handles all the logic about deciding whether or not to print at all and looping over the found set of invoices, and another script that only deals with printing one invoice at a time called as a subscript of the first script. That second script should wind up looking something like this:


If [ /* country group 1 and no line items*/ ...]

Go to Layout [...]

# layout based on Invoice table

Else If [ /* country group 1 and there are line items */ ...]

Go to Related Record [invoiceLineItems using layout ...]

Else If [ /* country group 2 and no line items*/ ...]

Go to Layout [...]

Else If [ /* country group 2 and there are line items */ ...]

Go to Related Record [invoiceLineItems using layout ...]

...

Else

Exit Script [Result:Error]

End If



Print Setup [...]

Perform Script ["Window Control Preview"]



If [layout is based on InvoiceLineItems]

Sort Records [...]

Print [Records being browsed]

Else

# layout is based in Invoice

Print [Current record]

End If



Go to Layout [Original Layout]

Enter Browse Mode

Exit Script []

Identify everything that's common to the process of printing for each situation, and group them together outside If[] blocks as much as possible.

Create an account or sign in to comment

Important Information

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

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.