AnsweredAssumed Answered

creating new records from found set

Question asked by willrollo on Jul 28, 2013
Latest reply on Jul 31, 2013 by willrollo

Title

creating new records from found set

Post

     I have created a list of customers that Have been sent a letter. When this letter has been printed, various fields (date printed ) etc are filled so I know when the customer was sent a letter. However, I have also created a 'To Do' table. This works by creating a new reminder record that has fields such as ToDo:name text, date due etc.

     What I wanrt to be able to do is when I click print,  I want a dialogue to appear asking if a reminder is required. Yes/No. 

     If Yes, then the found set (those customers selected for printing) will now have a new related To Do record stating the name of the customer/text, due date etc.

     Ihave got it half working - the main issue is that I cannot get the related customer info (name) into the new reminder record, and only one record is being created. I am inepxrienced with the 'loop' expression and unsure if this is what is required here. I have apsted my attempt below...dodgy bit highlighted in red....thank you

      

         
  •           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 ]
  •      
  •           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::Follow up letter type ]
  •      
  •           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 ]
  •      
  •           Set Variable [ $ID_Contact; Value:INVOICE DETAILS::ID_Customer_Billing_fk ]
  •      
  •           Set Variable [ $note; Value:Customers::Follow up letter type ]
  •      
  •           Freeze Window
  •      
  •           Go to Layout [ “TO DO” (contacts_TO DO) ]
  •      
  •           Go to Record/Request/Page [ First ]
  •      
  •           New Record/Request
  •      
  •           Set Field [ contacts_TO DO::ID_Customers_fk; $ID_Contact ]
  •      
  •           Set Field [ contacts_TO DO::Name_To Do; Customers::Address To ]
  •      
  •           Set Field [ contacts_TO DO::Date Due; Get(CurrentDate)+14 ]
  •      
  •           Set Field [ contacts_TO DO::Text; $Note ]
  •      
  •           Commit Records/Requests [ Skip data entry validation; No dialog ]
  •      
  •           Go to Layout [ “ContactList” (Customers) ]
  •      
  •           End If
  •      
  •           If [ Get(LastMessageChoice) = 3 ]
  •      
  •           Exit Script [ ]
  •      
  •           End If
  •      
  •           Go to Layout [ “ContactList” (Customers) ]

Outcomes