THIS IS SUPPOSED TO BE IN THE WINDOWS APPLICATION THREAD. DF 24.0
Ran into a somewhat odd behavior when writing to a log.txt file within process A and and calling a function from a business process.
As the process runs, many log entries are created within the log.txt file.
Once the call to a function of a business process is made, writing to the log is suspended and send directly to my default printer.
Code:
Direct_Output "\log\process_output.txt"
Writeln ("Start Update procedure: "+String(dtCurrent))
Writeln (">>> Searching for active Employer records...")
//Call to bp to create attachment for employer.
Get CreateAttachment of oAttachments sDownloadFilePath hTable hColumn iEmployerIdno (iContrId<>0) hTable sEmployerName "" (&iAttachIdno) to bSuccess
// When CreateAttachment is called, writeln will no longer write to "process_output.txt" file but instead will send the remainder of the writeln output directly to my printer.
Writeln (String(CurrentDateTime())*"Attachment record created: iAttachIdno:"*String(iAttachIdno)*"|"*sDocumentId)
Writeln (String(CurrentDateTime())*"Attachment record updated with: ContractID:"*String(iContrId)*' and ContractFlag:'*String(iContrId<>0))
Writeln (">>> Updating contract record with new file path...")
What is that all about?