AnsweredAssumed Answered

Printing a batch using different layouts

Question asked by willrollo on Mar 4, 2014
Latest reply on Mar 4, 2014 by willrollo

Title

Printing a batch using different layouts

Post

     I am trying to create a script that will print out a batch of letters depending on the data on a particular field for each customer. The print layout is determined by this field. 

     I cant seem to get it to work. the script selects the correct customers, but the layouts are not correct. I think I know why, I jsut cant work out how to fix it...Below is the script..:

     Thank you

      

         
  •           Perform Find [ Specified Find Requests: Find Records; Criteria: CUSTOMERS::Follow Up required Check Box: “Y” ] [ Restore ]
  •      
  •           #Set Reminder
  •      
  •            
  •      
  •           If [ CUSTOMERS::Followed Up ="Yes" ]
  •      
  •           Show Custom Dialog [ Title: "Error"; Message: "You have already sent a follow up letter to "& CUSTOMERS::To Retail & ". To reset this, please select the follow up letter you would like to print from the dropdown menu under the Status header."; Default Button: “OK”, Commit: “Yes” ]
  •      
  •           Show All Records
  •      
  •           Exit Script [ ]
  •      
  •           End If
  •      
  •            
  •      
  •           If [ CUSTOMERS::Follow Up Actions Box = "Tel Follow Up" ]
  •      
  •           Go to Related Record [ From table: “CUSTOMERS”; Using layout: “Tel Follow Up” (CUSTOMERS) ] [ Show only related records; Match found set ]
  •      
  •           Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ Restore; No dialog ]
  •      
  •           Enter Preview Mode
  •      
  •           Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore: Kitchen Printer; No dialog ]
  •      
  •           Enter Browse Mode
  •      
  •           Else If [ CUSTOMERS::Follow Up Actions Box = "No new enquiry letter" ]
  •      
  •           Go to Related Record [ From table: “CUSTOMERS”; Using layout: “Brochure Followed Up” (CUSTOMERS) ] [ Show only related records; Match found set ]
  •      
  •            
  •      
  •           Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ Restore; No dialog ]
  •      
  •           Enter Preview Mode
  •      
  •           Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore: Kitchen Printer; No dialog ]
  •      
  •           Enter Browse Mode
  •      
  •           Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ Restore; No dialog ]
  •      
  •           Enter Preview Mode
  •      
  •           Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore: Kitchen Printer; No dialog ]
  •      
  •           Enter Browse Mode
  •      
  •            
  •      
  •           Else
  •      
  •           Show Custom Dialog [ Title: "Error"; Message: CUSTOMERS::To Retail & " does not need a follow up. To reset this, please select the follow up letter you would like to print from the dropdown menu under the Status header."; Default Button: “OK”, Commit: “Yes” ]
  •      
  •           Exit Script [ ]
  •      
  •           End If
  •      
  •            
  •      
  •           Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ Restore; No dialog ]
  •      
  •           Enter Preview Mode
  •      
  •           Print [ Records being browsed; All Pages; Orientation: Landscape; Paper size: 8.26" x 11.69" ] [ Restore: Kitchen Printer; No dialog ]
  •      
  •           Enter Browse Mode
  •      
  •            
  •      
  •           If [ Get(LastError)=0 ]
  •      
  •           Replace Field Contents [ CUSTOMERS::Follow_Up_Date_Old; Replace with calculation: CUSTOMERS::Follow_Up_Date_Recent ] [ No dialog ]
  •      
  •           Replace Field Contents [ CUSTOMERS::Follow_Up_Date_Recent; Replace with calculation: Get(CurrentDate) ] [ No dialog ]
  •      
  •           Replace Field Contents [ CUSTOMERS::Follow Up Actions Box; Replace with calculation: "Followed Up" ] [ No dialog ]
  •      
  •           Replace Field Contents [ CUSTOMERS::Follow Up required Check Box; Replace with calculation: "" ] [ No dialog ]
  •      
  •           Replace Field Contents [ CUSTOMERS::Followed Up; Replace with calculation: "yes" ] [ No dialog ]
  •      
  •           Else
  •      
  •           Show Custom Dialog [ Title: "Error"; Message: "There was an error printing these follow ups- please try again"; Default Button: “OK”, Commit: “Yes” ]
  •      
  •           End If
  •      
  •           Show All Records
  •      
  •           Go to Layout [ original layout ]

Outcomes