Upgraded to 9.1 and now MsgBox's do not work when debugging Workflow using SDK Scripts.
any Ideas?
Upgraded to 9.1 and now MsgBox's do not work when debugging Workflow using SDK Scripts.
any Ideas?
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Microsoft.VisualBasic
Imports LFSO83Lib
Namespace WorkflowActivity.Scripting.SetValidGLCoding
'''<summary>
'''Provides one or more methods that can be run when the workflow scripting activity is performed.
'''</summary>
Public Class Script1
Inherits SDKScriptClass83
'''<summary>
'''This method is run when the activity is performed.
'''</summary>
Protected Overrides Sub Execute()
Dim Doc As LFDocument = me.Entry
'Get the collection of fields for the doc
Dim FD As ILFFieldData = Doc.FieldData
Dim SqlId as String = string.Empty
MsgBox(FD.Field("GLCoding").ToString)
SqlId = FD.Field("SqlId").ToString()
FD.Field("GLCoding").TrimEnd(",")
FD.Update()
Dim GLLines() as String
Dim GLItems() as string
Dim DefaultEntity as String = FD.Field("Supplier Entity").ToString()
SetTokenValue("CompanyName", FD.Field("Company Name").ToString())
SetTokenValue("UserName", Doc.ParentFolder.Name.ToString())
SetTokenValue("ValidGLCoding", "0")
SetTokenValue("PendingFolder","MagInvoicing\" + FD.Field("Dept").ToString + "\PendingReceipts")
''check GL Coding
If Not IsNothing(FD.Field("GLCoding")) Then
If (FD.Field("GLCoding").ToString <> "") Then
GLLines = FD.Field("GLCoding").ToString().Split(",")
For Index as Int32 = 0 to GLLines.Length - 1 Step 1
If(GLLines.Length >= 1) Then
GLItems = GLLines(Index).Split("_")
MsgBox(GLItems.Length)
If(GLItems.Length = 6) then
SetTokenValue("ValidGLCoding", True)
MsgBox(GLItems(1).ToString() <> DefaultEntity)
If GLItems(1).ToString() <> DefaultEntity Then
MsgBox("Entity Bad")
Else
Msgbox("Entity Good")
SetTokenValue("ValidGLCoding", "1")
MsgBox(GetTokenValue("ValidGLCoding"))
End if
SetTokenValue("GLCoding", FD.Field("GLCoding").ToString())
Exit For
Else
MsgBox("GLCoding Bad")
SetTokenValue("ValidGLCoding", False)
Exit For
End If
End If
Next
Else
End IF
End IF
Doc.Update()
Doc.Dispose()
End Sub
End Class
End Namespace
Changed the code to this and still can not debug
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Microsoft.VisualBasic
Imports LFSO83Lib
Namespace WorkflowActivity.Scripting.SetValidGLCoding
'''<summary>
'''Provides one or more methods that can be run when the workflow scripting activity is performed.
'''</summary>
Public Class Script1
Inherits SDKScriptClass83
'''<summary>
'''This method is run when the activity is performed.
'''</summary>
Protected Overrides Sub Execute()
SetTokenValue("ValidGLCoding", False)
Dim Doc As LFDocument = me.Entry
'Get the collection of fields for the doc
Dim FD As ILFFieldData = Doc.FieldData
Dim SqlId as String = string.Empty
MsgBox(FD.Field("GLCoding").ToString)
SqlId = FD.Field("SqlId").ToString()
Dim GLLines() as String
Dim GLItems() as string
Dim DefaultEntity as String = FD.Field("Supplier Entity").ToString()
SetTokenValue("ValidGLCoding", False)
SetTokenValue("CompanyName", FD.Field("Company Name").ToString())
SetTokenValue("UserName", Doc.ParentFolder.Name.ToString())
SetTokenValue("PendingFolder","MagInvoicing\" + FD.Field("Dept").ToString + "\PendingReceipts")
SetTokenValue("GLCoding", FD.Field("GLCoding").ToString())
''check GL Coding
If Not IsNothing(FD.Field("GLCoding")) Then
If (FD.Field("GLCoding").ToString <> "") Then
GLLines = FD.Field("GLCoding").ToString().Split(",")
For Index as Int32 = 0 to GLLines.Length - 1 Step 1
If(GLLines.Length >= 1) Then
GLItems = GLLines(Index).Split("_")
If(GLItems.Length = 6) then
SetTokenValue("ValidGLCoding", True)
MsgBox(GLItems(1).ToString() <> DefaultEntity)
If GLItems(1).ToString() <> DefaultEntity Then
MsgBox("Entity Bad")
SetTokenValue("ValidGLCoding", False)
Exit For
Else
Msgbox("Entity Good")
SetTokenValue("ValidGLCoding", True)
MsgBox(GetTokenValue("ValidGLCoding"))
End if
Else
SetTokenValue("ValidGLCoding", False)
Exit For
End If
End If
Next
Else
End IF
End IF
Doc.Update()
Doc.Dispose()
End Sub
End Class
End Namespace