1 Reply Latest reply on Feb 6, 2012 2:27 AM by RayCologon

    Printing same record using different layouts

    ssnodgra

      I am using the following script to print an invoice from the Business Productivity Solution . I want to print the same record using three different layouts (Factory Order, Packing List, File Copy). I want it to print the two additional pages without any dialog.

      The layouts are different. Sales Order, Packing List. File Copy

       

       

      Allow User Abort [Off]

      Set Error Capture [On]

      If [not(fnIsWebConnection)]

      If [Line Items::Sales Order ID]

      Go to Related Record [Show only related records; From table: "Line Items:; Using layout: (Current Layout>;New window]

      Print Setup [Restore; No dialog]

      Enter Preview Mode []

      Adjust Window [Resize to Fit]

      If [Get(ScriptParameter) = "Print"]

      Print []

      Perform Script ["Print Sales Order"]

      else

      Pause/Resume Script [Indefinately]

      End If

      Close Window [Current Window]

      Else

      Show Custom Dialog ["Alert"; "There are not line items to display."]

      End If

      Else

      If [Line Items:Sales Order ID]

      Go to Related Record [Show oly related records; From table: "Line Items"; Using layout "Sales Order"(Line Items)]

      Pause/Resume Script [Indefinately]

      Go to Layout [original layout]

      End If

      End If

      #

      #

       

      Can anyone provide add the logic to this script to make this happen?

       

      Thanks

        • 1. Re: Printing same record using different layouts
          RayCologon

          ssnodgra wrote:

          ...Can anyone provide add the logic to this script to make this happen?

           

          Hello ssnodgra,

           

          Assuming that you call the above script from the Sales Order layout, that each of the three layouts is based on the same table occurrence, that the layouts are all set up for the same paper size and that you want them all printed with the same print setup, if you include the following five additional steps after the 10th step of the script you posted:

           

          Go to Layout ["Packing List"]

          Print [Restore; No dialog]

          Go to Layout ["File Copy"]

          Print [Restore; No dialog]

          Go to Layout [original layout]

           

          ...then the packing list and file copy will print along with the sales order whenever the script runs from a non-web connection.

           

          If you need to be able to launch the script from any of the three layouts and still have it print the correct three copies, you'll need some additional logic to handle that, but hopefully the above will get you on the right track.

           

          Regards,

          Ray

          ------------------------------------------------

          R J Cologon, Ph.D.

          FileMaker Certified Developer

          Author, FileMaker Pro 10 Bible

          NightWing Enterprises, Melbourne, Australia

          http://www.nightwingenterprises.com

          ------------------------------------------------