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.

Script_Save pdf_Set Field Value on a g_Find

Featured Replies

I am trying to write a script to save an Invoice pdf.

Manually the steps are:

Step 1: Go to Layout xyz

- xyz layout is a list layout, based on a Lines Table.

on layout xyz there is a find script that selects all lines related to an InvoiceID.

Step 2: Set field g_Find_InvoiceID

- this is a drop down value list based on a field, c_Find_InvoiceID that finds all Invoice ID

Step 3: Run script

This script is:

Enter Find

Set Field:(INVOICES:: kp_InvoiceID; LINES::g_Find Lines_InvoiceID)

Perform Find

Step 4:

I save as pdf

Is it possible to automate these steps from the Invoices layout where the g_Find InvoiceID is automatically set to current value of kp_InvoiceID on the Invoices layout?

I am using the Lines layout to produce an Invoice ID because it allows me to create a continuous Invoice using the Invoice portal data that page breaks appropriately.

Thanks

Matthew

  • Author

I resolved this problem by placing the g_Find Lines InvoiceID field on the Invoice layout and then Set Field g_Find Lines InvoicesID; kp_InvoicesID. Then the rest of the script. It worked. Maybe someone knows a way without needing to place a redundant field on the Invoices layout

Just take the user through a find. Why the global?

  • Author

I am not sure why a global. It seems to me that it is just acting as a venue for a calculation result. If you look at the post '

Calculation - find fields results by month' Ms LaRetta shows one how to create a Find engine. It is a very handy technique. I have attached my solution script.

post-104472-0-17657600-1337904302_thumb.

This technique uses the global field to capture search criteria and then scripts the find.

My questions for your situation are:

1. Where is the user when he wants to email an invoice? Isn't he in the Invoice table? Why would he be in the Invoice Line Items table?

2. So, couldn't you have them navigate or find in Invoices and then simply click a button on the invoice to send it as a PDF (like in my demo).

The global technique is nice, but only if the user knows the Invoice ID. What if they don't? Giving the user a FIND layout based on the Invoice table would let them search invoices using any field. Such as the Invoice's Customer, Date, ID and any line item.

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.