PublishDebuggingInfo
This function is used for ION integrations with Optiva.
Purpose
The function PublishDebuggingInfo is primarily used for debugging. When you add debugging statements in your script, each statement writes a message to the DEBUGLOG column in the FsActionWipResults table. If the script runs partially or fails, the log shows only the messages that were executed before the failure.
Syntax
void PublishDebuggingInfo(string inMessage, string Status = "")
Return Value
The function do not return anything but adds a line in DEBUGLOG.
Arguments
| Part | Description |
|---|---|
inMessage |
The debug message you want to log. |
Status |
Optional. Status or label to categorize the message. Value entered in Status arguments are displayed in the ACTIONSTATUS column of FsActionWipResults. |
Description
Suppose you have a script that is not working and you add some debugging.
- Only one row is generated in the
FsActionWipResultstable. - The DEBUGLOG column has four lines in it. Each line is separated by a line break.
If you know the name of the Action and what time it was run, you can look up the row in the FsActionWipResults table. Read all the logging entries. See if it hit every debugging statement, or if it failed somewhere before finishing.
Example
The debugging code is in bold text and highlighted in blue.
Option Strict Off
Imports System
Imports System.Data
Imports System.Diagnostics
Class ActionScript
Inherits FcProcFuncSetEventWF
Function wf_start() As Long
Dim ds As DataSet = ObjectDataSet("", "")
Dim IngrTableName As String = DataSetTableName("", "", "INGR")
PublishDebuggingInfo(“IngrTableName = “ & IngrTableName)
Dim IngrTable As DataTable = ds.Tables(IngrTableName)
Dim newIngrRow As DataRow = GetNewRow("", "", "INGR")
newIngrRow("ITEM_CODE") = "01001"
newIngrRow("QUANTITY") = 15.5
newIngrRow("UOM_CODE") = "LB"
PublishDebuggingInfo(“All values set into newIngrRow at this point”)
RowUpdate("", "", "INGR", newIngrRow)
PublishDebuggingInfo(“newIngrRow is updated”)
CommitNewRow("", "", "INGR", newIngrRow)
PublishDebuggingInfo(“newIngrRow is committed”)
Return 111
End Function
End Class
PublishDebuggingInfo ("All values set into newIngrRow at this point");
This example adds a row with above message in DEBUGLOG column of FSACTIONWIPRESULTS table. ACTIONSTATUS of this row is empty as the argument is not passed as part of function call.
Example 2: PublishDebuggingInfo("All values set into newIngrRow at this point", "SUCCESS");
inMessage - All values set into newIngrRow at this point
Status - SUCCESS
This example adds a row with the above message in DEBUGLOG column of FSACTIONWIPRESULTS table and it's classified as SUCCESS(Status).
Example 3: PublishDebuggingInfo("Begin processing formula object", "INFO");
Example 4: PublishDebuggingInfo("RowUpdate: args validated and bound", "DEBUG");
Example 5: PublishDebuggingInfo("RowUpdate failed: Column 'QTY' type mismatch", "ERROR");