Back to forum list… Back to How Do I?...

Best way to audit a script task? (3 replies)

Arline Welty
4 years ago
Arline Welty 4 years ago

I'm trying to figure out whether a script is running successfully or not...is there a recommended way to do that?

I have a script task that deletes some values from a table. It's the first part of a transform job. I would like to attach auditing to it, but I'm not sure how. I could just add a summary line that says 'script task was invoked' but ideally I could see how the script task performed. are there any variables I could use? Or other suggestions?

 

 

https://www.realisable.co.uk/wp-content/uploads/2019/10/Variables-for-Script-Task-Audit.jpg
Support
4 years ago
Support 4 years ago

There is no way to audit the Script Task....especially not at the start.

You're best to just use the Log Transform Start, Log Transform End.

Assume the transform is running; an error will be raised otherwise.

Arline Welty
4 years ago
Arline Welty 4 years ago

Can you clarify Log transform start/end? I am querying the AUDITLOG table but not sure I'm seeing an exact correspondence there.

I'm skeptical of whether it's running because of the logic involved in the job. Ideally it :

  1. Script task drops rows from a custom table where the row is of a certain "KEYPURPOSE" Type.
  2. That is followed by a Read transform which queries a Sage 300 database for records with a certain "KEYPURPOSE" Type.
  3. Then, we us a DB writer transform to insert the fresh rows from the view back into the custom table. 

The thing that is going wrong is that on the DB Write transform, it's throwing a primary key constraint error, indicating that the row it wants to insert actually exists in the table. If the row were successfully dropped, it would not exist in the table, and we wouldn't get a primary key constraint error. But since it throws the error, it indicates to me that the row is still in the table. It's working ok on a test database with a smaller result set, so I am suspicious that that is a factor but I need more data!

Support
4 years ago
Support 4 years ago

I am wondering if the Script Task is timing out, when deleting the records....but not reporting the error.

In your script task, before you call 'Execute' (to delete the rows) add the following. This will extend the timeout to 60 seconds.

Alter this value accordingly, and alter the 'dbConnection' object reference to whatever your connection is named.

dbConnection.CommandTimeout = 60
 
Then you need to alter the Script timeout itself, to be greater than the number of seconds set to the CommandTimeout.
Hope this makes sense.

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close