Example using GetSetByKey

Below is an example using GetSetByKey, CommitKeyObjects, and ReleaseKeyObjects.

Dim XSet As Object

Dim XForm As Object

Dim Key AsString

Dim Result AsInteger

 

’ Fetch first key from external source

’ **** Code for fetching the Key goes here

 

’ Get first specified set

Set XSet = Application.GetSetByKey( Key, Result )

 

If Result = 0 Then

    ’ If set found OK, process it. In this case, change the queue for the

    ’ first form in the set.

 

    Set XForm = XSet.GetFirstForm ( 1,1,1,1,1,1,1 )

    XForm.SetQueueStatus( 1 )

End If

 

’ Commit, i.e. save changes in FORMS database

Application.CommitKeyObjects()

 

’ Fetch next key from external source

’ **** Code for fetching the Key goes here

 

’ Get next specified set

Set XSet = Application.GetSetByKey( Key, Result )

 

If Result = 0 Then

    ’ If set found OK, process it. In this case, change the queue for the

    ’ first form in the set.

 

    Set XForm = XSet.GetFirstForm ( 1,1,1,1,1,1,1 )

    XForm.SetQueueStatus ( 1 )

End If

 

’ Commit, i.e. save changes in FORMS database

Application.CommitKeyObjects()

 

’ Free up memory occupied by the form definitions of fetched forms

Application.ReleaseKeyObjects()

 

GetFormByKey

The Application object