Inhaltsverzeichnis

LoadDocumentByOid

The mapping function LoadDocumentByOid() allows access to a different document type1) within the same message of the currently loaded entity. Theoretically, any document can be loaded from eBiss2) to write data coming from more than one source into a target document, for example.

Usage

LoadDocumentByOid(['Oid'])

Note: As parameter a valid DocumentOid3) must be used. Otherwise the function returns <null>.

Example

A message4) contains a file with the delivery, and a file with the price master data. These are fetched from a receiving channel and unpacked automatically. The prices for the delivery data can now be looked up in the inbound mapping.

The Oid5)is determined with the GetMessage() function. In the example case you want the document that is within the same message and of type LSB.
First you determine the Oid with:

GetMessage()/Documents[ @DocumentType = ‚LSB‘ ]/@Oid

and writes the value into a variable, for example $oid.
Then you are able to assign the loaded Document into an abstract variable e.g: $$refDoc

LoadDocumentByOid($oid)

after that, you are able to determine the correct line from the variable refDoc for price determination:

//note: variable call with only one "$"
$refDoc/Lines[ @ArtNr = $artNr ]/@SuggestedRetailPrice

and into the target element, here for example “SuggestedRetailPrice”.

Note: The function can be executed interactively in the debugger. You can use a previously determined oid as a constant. The function result is displayed as a tree in the left window of the mapping editor as usual in the Result tab.

1)
not to be confused with the MultiEntityTransformer
2)
assuming you can determine the Oid!.
3) , 5)
Oid = a Object Identification for a data set in the eBiss database which is uniquely assigned by eBiss system-wide.
4)
e.g.: each in a mail with 2 zipped attachments