5.12.1.8.2. Fill list field via VBS expression

In addition to a CFG file, you can also use square brackets "[ ]" VBS expressions, which fill the list field with values.

Examples:

  • PARTdataManager:

    [modulname.funktionsname(comboBox#erpdata)] 
    comboBox.Items.Add("Wert1") 
    comboBox.Items.Add("Wert2")
  • 3Dfindit:

    [modulname.funktionsname(values)]
    values.Add("DE")
    values.Add("Deutschland")
    values.Add("FR")
    values.Add("Frankreich")

    Every two calls result in a list entry: first the stored value, then the displayed text. The list shows “Germany” and “France”; “DE” and “FR” are stored, respectively.

In 3Dfindit, the syntax `comboBox.Items.Add ` from the PARTdataManager does not work. Instead, the VBS expression can directly return an array. For each list entry, the array contains two elements: first the stored value, then the displayed text. Both may be the same. To add multiple entries, append additional pairs.

[Array("nb", erpdata.table.selectedRow.GetTranslatedSHORTNB("german"))]

In this context, the following variables can also be passed to the function:

  • comboBox: The object of the ComboBox to make direct adjustments to it

  • erpdata: The internal ErpData object for data record creation (here you can get the current table via erpdata.Table, for example)

  • userField: The configuration of the field

  • values (only 3Dfindit): An array containing the values, always as pairs consisting of the stored value and the displayed value