May 22, 201213 yr 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
May 24, 201213 yr 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
May 25, 201213 yr 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.
May 25, 201213 yr 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