You are viewing limited content. For full access, please sign in.

Question

Question

MsgBox

asked on March 25, 2014

Upgraded to 9.1 and now MsgBox's do not work when debugging Workflow using SDK Scripts.

 

any Ideas?

0 0

Replies

replied on March 26, 2014

Ray,

 

I can't reproduce it. Can you post sample code, please?

0 0
replied on April 2, 2014

Script does even run I think when I press F5.

 

0 0
replied on April 2, 2014

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

0 0
replied on April 2, 2014

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

Capture.GIF
Capture.GIF (104.09 KB)
0 0
replied on April 2, 2014

Figured it out. Now how to explain the issue and fix it?  hummm

0 0
replied on March 21, 2016

I am having the same issue, what did you figure out?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.