Toad World® Forums

Upgrade from 4.1 to 4.2 has broken some automations

Just had my machines upgraded to 4.2 from 4.1 yesterday. Went through the process of migrating settings and updating my scheduled tasks to run in 4.2. Several of my reports create an initial excel file and then subsequent steps insert data in to new worksheets. Started getting errors on my automations this morning and the log file states that it cannot process the second Select To File and returns the error “File_2 - Cannot create a file when that file already exists.” The automations all worked fine in all of the previous versions I had. Is there a fix/work around for this?

(For 4.2.1.303)

I figured out what the issue was. It appears to have something to do with the date suffix format in the export settings of the Select To File tasks. In 4.1, the format used was ‘YYYY-MM-DD’ and when trying to run in 4.2, this version wasn’t recognizing the format. I noticed this when checking my files and seeing no date appended after the first Select To File ran in my automations. I went through each of my Select To File tasks and changed the format to ‘yyyy-MM-dd’, saved, and reran. The scripts performed as designed without error after this change.

4.1 Export Settings from an Automation opened in 4.2:

Migrated_4_1_STF_Export_Settings.png

4.2 Export Settings after Date format changed:

Fixed_4_2_STF_Export_Settings.png

hi Chris,

Thank you for the report.

In 4.1 the Suffix control supports automation expressions (once clicked on the (x)= button Expression editor opens):

In 4.2 the Suffix control only supports automation expressions from scripts created by 4.1 and lower - meaning you can’t edit / add expression to Suffix control from within 4.2 GUI (as it became a dropdown):

So in 4.2 there are only 3 hardcoded suffix values available (Date, DateTime 24h, DateTime 12h AM/PM) and I believe the “Append worksheet” when FileOverwrite=false feature is hardcoded to be working with these 3 values only. So when you take 4.1 script and open it in 4.2 then for backward compatibility the “existing expression” was copied (your first screenshot) but the “Append worksheet” feature stops working which is a bug (because, as you wrote, it will start working when you manually switch back to the predefined suffix from dropdown).

So yes, the workaround for these 3 suffixes is to manually select the correct suffix from the control, however this workaround doesn’t apply to cases where you would have a completely custom expression in the Suffix control because there is no corresponding “4.2 suffix version” that would work with the Append worksheet feature.

This bug along with many others are handled in 4.3 though.

Thanks Martin, I appreciate your response. I did go through my automations and manually adjust the suffix and on day 2, there appears to be no issues. We will keep an eye out for the 4.3 release and put the request in to package with our IT department.