Get Document from Database Builder

The Get Document from the Database will retrieve a document record by ID and store the contents into a DocumentItem.

All specified properties will also be stored into variables.

media_1481566824301.png

Select the Business Object Type that will be retrieved.

Click the arrow on the right to select from a list of object types.

Click next once one is selected.

media_1481568392796.png

The Document Criteria will be used to ascertain what document to be retrieved.

media_1481631729918.png

Values can be passed into Criteria by creating a parameter.

By enclosing a value in { } brackets, that flags the word as a parameter. The name of the parameter, in the picture, would be documentName.

Parameters will have the value substituted during the script execution.

media_1481568414003.png

If parameters are found in the Criteria, they wil be listed in the Name drop down.

Name – the name of the parameter within the criteria.

Type – type of value to be expected (String, Bool, Date, Decimal, Number).

Variable – the variable that will hold the value. The drop down will contain existing variables or type in a new variable name.

Click the Add button to add the parameter name and value to be substituted.

media_1481568429642.png

media_1481631892047.png

Select the properties, of the object type, that will be retrieved.

Select the Property.

Type in a Variable name or select from a list of existing Variables that will hold the value of the property.

Click the Plus button to add that property to the list to be retrieved.

Click Finish once all property values have to be retrieved have been added.

Note: All property variables will need to be set prior to running this portion of the script.

media_1481568497898.png

Selecting Yes will send the document contents to the default printer.

Created Script

media_1481632070981.png

Add Text Criteria Parameter – maps a Criteria Parameter to a value to be substituted with.

Find Record By Criteria – retrieves the first record, in the database, that matches a Criteria and sets that record to a variable.

Get Property (Get DocumentName) – this retrieves the value of the property and puts that value into a variable. There will be a Get Property action for each property that was added.

media_1481632099033.png

Get Record Content – retrieves the document content from the record and places it into a variable.

New Document Item – creates a new DocumentItem and sets that to a variable.

Set DocumentItem Content – sets the newly created DocumentItem content to the record content variable.

Print Document – prints the content from the DocumentItem.

Tutorial