Update Document from File Builder

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

All specified properties will also be stored into variables.

media_1481640412152.png

Select the Business Object Type that will be updated.

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

Click next once one is selected.

media_1481640485675.png

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

media_1481640508013.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_1481640534099.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_1481640556539.png

media_1481640580633.png

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

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_1481641048000.png

The variable that will hold the path to the document file.

You can type in any variable name or select existing variables from the drop down.

Note: this variable will need to be set to the actual path prior to portion of the script.

Created Script

media_1481641081168.png

New Document Item – creates a new DocumentItem that will be used in loading the file. Imagine the DocumentItem as your wordprocessor application.

Load Document File – this takes the DocumentFile and passes the path to the local file to be loaded.

Get DocumentItem Content – retrieve the Rtf content of the document file and set it to a variable.

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

media_1481641100895.png

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

Set DocumentName – this sets the Property to the value of a variable. There will be a Set Property action for each property that was added. Note: these variables will need to be set prior to this portion of the script.

Set Record Content – sets the record content to the variable that holds the DocumentItem content.

Commit All Changes – saves all changes to the database.

Tutorial