The server side module defines code which only exist when running server side for batch output creation. It can be used to modify the output further and use the batch information of the current record to populate the output.

As multiple scripts can be assigned to the output, it is important to sync them up accordingly. There is a flag available to block the output creation until the data is prepared. Then other scripts can use the data once it is ready. They can do that by registering for the RegisterForServerSideOutputCreation event. To ensure this works, the execution order of the scripts are important and the block call should be the first operation in the script outside of any function call.

Example

// We block first the server side output creation to ensure we have the data available before any output is generated.
Editor.ServerSide.BlockServerSideOutputCreation(true);

// Next we get the data object for the current record.
Editor.ServerSide.GetServerSideDataObject(function (data) {
// and we update the mapped data for the current record.
Editor.ServerSide.SaveMappedData({ "jobId": Job.JobId(), "recordId": data.RecordNumber }, function () {
// now we can unblock so other scripts (e.g. batch script) can use that information.
Editor.ServerSide.BlockServerSideOutputCreation(false);
});
});

Index

Enumerations

Interfaces

Generated using TypeDoc