Description
Displaying Selection forms with Basic Document Data
You can display a selection form with basic document data to users. If a user selects a line in the form the line code will be returned as a result. In this way, for example, a user can assign a document type to all documents to be mass-imported. There are methods for displaying the following selection forms:
The code in the following exampe displays the Documentation actions form and in addition, returns the line code of the selected line.
Dim lCode As String
If oDMLink.Utility.SelectDocumentAction(lCode) Then
MsgBox "The selected action code is: " & lCode
End If
Displaying the Selection Form for Isah Items
The Entity selection form (F1210) enables the user to select an Isah item that can be linked to documents, for example parts and customers. You can define the list of Isah items the user can choose from and the order in which they are displayed in a tree structure. If the user has selected an item, the key fields of the item will be returned as a result. By clicking OK, the TableId en PrimKey values of the SelectIsahItem function will contain the values of the item that the user has selected and the result of the function will be TRUE, provided that the user has selected a valid item.
You can use the form if it is unknown beforehand what kind of Isah item the user will select. For example, it depends on the sender to which item a letter should be linked if the user wants to register it. The sender could be a customer, supplier or employee. Only after the user has confirmed his choice by clicking OK the item can be determined.
If the user selects an item from the tree structure, a list will be displayed that corresponds with the list in the Isah form of the particular item. For example, if the user selects 'Parts' from the tree structure, the part list is displayed in which the user has similar access to presets, list functions, menu items, etc. as in the Parts form.
You can create a tree structure with Isah items a user can choose from, by entering TableIds in an array. All TableIds that refer to Isah items linkable to documents can be incuded. The order of the TableIds in the array determines the order in which the Isah items will be displayed in the tree structure. Child items will automatically be linked to its parent item. For example, if you enter the part revision TableId it will automatically be displayed under Parts. If the array contains just one TableId, the item will not be displayed in a tree structure unless it is a child item. Only items the user has sufficient rights for will be displayed in the tree structure.
Example
The following example shows how to create an array of TableIds that determines the tree structure in the Entity selection form from which the user can select an Isah item:
Dim lTableIds(5) As Integer
Dim lTableId As Long
Dim lPrimKey As String
lTableIds(0) = 12 '' - Parts
lTableIds(1) = 14 '' - Part revisions
lTableIds(2) = 19 '' - Parts bill of material
lTableIds(3) = 9 '' - Customers
lTableIds(4) = 10 '' - Suppliers
lTableIds(5) = 13 '' - Employees
If oDMLink.Utility.SelectIsahItem(lTableIds, lTableId, lPrimKey) Then
MsgBox "The selected entity is TableId = " & lTableId &_
", PrimKey = " & lPrimKey
End If