Skip to main content

Value lookups

Value lookups will copy values from other records to the current one. The normal usecase is records referring other records via parent references.

  • getValueFromLookup(SourceSagID,SourceDataID,FieldNameSource)
  • setValueFromLookup(SourceSagID,SourceDataID,FieldNameSource,FieldNameTarget)

The function will

  1. Make a call to ?SagID=[SagID]&DataID=[DataID]&command=show
  2. Pickup the value in the page at #VB_DATA_[FieldNameSource]
  3. Insert the value in the local fieldĀ FieldNameTarget

The DataID on the remote record can be picked up automatically by specifying FieldNameTrigger. Note this will only work as long as the trigger field is in editable and the value is changed.

  • setValueFromLookupTriggered(FieldNameTrigger,SourceSagID,FieldNameSource,FieldNameTarget)

The function will

  1. Extract the DataID form the field FieldNameTrigger
  2. Same as above