How to change Kofax batch priority from KTM script

189 Views Asked by At

The batch priority can be accessed in KTM using the batch XValue (AC_BATCH_PRIORITY) but I can't seem this is a read/Only field. I have searched KTM wiki but couldn't find any example which shows if this can be done.

Please advise if this is possible, if yes then if you could share an example that'll be great.

2

There are 2 best solutions below

0
Wolfgang Radl On

The batch priority should be read/write, at least according to the documentation: https://docshield.kofax.com/KTM/en_US/6.3.0-v15o2fs281/help/SCRIPT/ScriptDocumentation/c_BatchData.html?h=priority

Make sure to use the .Set method on XRootFolder.XValues.ItemByName ("AC_BATCH_PRIORITY"). If you attempt to change it by using the .Value property, MustSave may default to False, resulting in the updated value to be lost.

0
Ardox On

I've got a button to change priority from within validation like this

    Private Sub ValidationForm_ButtonClicked(ByVal ButtonName As String, ByVal pXDoc As CASCADELib.CscXDocument)
        Select Case ButtonName
            Case "PriorityDown"
                pXDoc.GetRootFolder().XValues.Set("AC_BATCH_PRIORITY","6")
            Case "PriorityUp"
                pXDoc.GetRootFolder().XValues.Set("AC_BATCH_PRIORITY","4")
        End Select
    End Sub