KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility method to create local info report every x ticks
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: January 25, 2023

When using the info report component, it can be useful to also generate local reports on the client side every interval. Here is a useful utility method that can handle info report generation on the client side:

C_TEXT($localFolderPath_t)

// Set local folder path
$localFolderPath_t:=Get 4D folder(Database folder)+"Folder_Reports"
aa4D_M_Folder_Rep_SetPath_local(->$localFolderPath_t)

// Create report every x ticks
Repeat
   aa4D_NP_Util_CreateReport(1)
  
   If (Process aborted=False)
     DELAY PROCESS(Current process; 300) // 60 ticks = 1s
   End if
  
Until (Process aborted)


In this example, logs will be generated every 5 seconds, but can be adjusted if necessary.