AnsweredAssumed Answered

Setting field on multiple records

Question asked by willrollo on Aug 9, 2013
Latest reply on Aug 9, 2013 by willrollo

Title

Setting field on multiple records

Post

     How do I set a few fields on several records that have been printed at once?

     Not sure where to put the set field step and if I need to use a loop...

     My script at the moment is this - confused parts in red:

      

         
  •           Perform Find [ Specified Find Requests: Find Records; Criteria: Customers::Mailmerge checkbox: “Y” ] [ Restore ]
  •      
  •           Go to Related Record [ From table: “Customers”; Using layout: “Preview (mail merge)” (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 [ Pause ]
  •      
  •           Print [ Records being browsed; All Pages; Orientation: Landscape; Paper size: 8.26" x 11.69" ] [ Restore: Kitchen Printer; No dialog ]
  •      
  •           Loop
  •      
  •           Go to Record/Request/Page [ First ]
  •      
  •           Set Field [ Customers::Follow_Up_Date_Due; Get(CurrentDate) ]
  •      
  •           Set Field [ Customers::Follow_Up_Date_Old; Customers::Follow_Up_Date_Recent ]
  •      
  •           Set Field [ Customers::Follow_Up_Date_Recent; Get(CurrentDate) ]
  •      
  •           Set Field [ Customers::Follow Up Actions Box; "Mail Merge Sent" ]
  •      
  •           Set Field [ Customers::Recent Contact; Customers::g_Lettername & " letter sent " & Get(CurrentDate) ]
  •      
  •           Go to Layout [ “ContactList” (Customers) ]
  •      
  •           Go to Record/Request/Page [ Next; Exit after last ]
  •      
  •           End Loop
  •      
  •           Enter Browse Mode
  •      
  •           #Set Reminder
  •      
  •           Show Custom Dialog [ Title: "Message"; Message: "Do you want to set a reminder to follow up this mail merge in two weeks? "; Default Button: “Yes”, Commit: “Yes”; Button 2: “No”, Commit: “No” ]
  •      
  •           If [ Get(LastMessageChoice) = 1 ]
  •      
  •           Go to Layout [ “ContactList” (Customers) ]
  •      
  •           Go to Record/Request/Page [ First ]
  •      
  •           Set Variable [ $note; Value:"Customer was sent " & Customers::g_Lettername & " merge letter, and needs following up. " ]
  •      
  •           Freeze Window
  •      
  •           Loop
  •      
  •           Set Field [ Customers::Follow Up required Check Box; "Y" ]
  •      
  •           Set Variable [ $ID_Contact; Value:Customers::ID_Contact_pk ]
  •      
  •           Set Variable [ $Address; Value:Customers::Address To ]
  •      
  •           Go to Layout [ “TO DO” (Customers_TO DO) ]
  •      
  •           New Record/Request
  •      
  •           Set Field [ Customers_TO DO::ID_Customers_fk; $ID_Contact ]
  •      
  •           Set Field [ Customers_TO DO::Name_To Do; $Address ]
  •      
  •           Set Field [ Customers_TO DO::Date Due; Get(CurrentDate)+14 ]
  •      
  •           Set Field [ Customers_TO DO::Text; $Note ]
  •      
  •           Commit Records/Requests [ Skip data entry validation; No dialog ]
  •      
  •           Go to Layout [ “ContactList” (Customers) ]
  •      
  •           Go to Record/Request/Page [ Next; Exit after last ]
  •      
  •           End Loop
  •      
  •           Else If [ Get(LastMessageChoice) = 2 ]
  •      
  •           Set Field [ Customers::Follow Up required Check Box; "" ]
  •      
  •           Exit Script [ ]
  •      
  •           End If
  •      
  •           Go to Layout [ “ContactList” (Customers) ]
  •      
  •           Show All Records
  •      
  •           Sort Records [ Keep records in sorted order; Specified Sort Order: Customers::Enquiry Date; descending ] [ Restore; No dialog ]
  •      
  •           Go to Record/Request/Page [ First ]

Outcomes