TSService.addNewRevision

Syntax

addNewRevision (wbk, metaData, callback);

Parameters

wbk. Sets workbook value.

metaData. Sets metadata that contains information on revision and time series database.

callback. Sets handler for operation execution end.

Description

The addNewRevision method adds a new revision.

Example

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), the repository must include a time series database with the 112 key, and the following code must be added in the document opening event handler:

	var source = workbookBox.getSource().getActiveSheet();//Return an instance of the PP.TS.WbkDocument class
	//Get the first workbook series
	var serie = source.getSeries()[0];
	var rubKey = 112;
	var name = "New revision";
	var metaData = { RubKey: rubKey, Operation: PP.TS.Ui.WbkRevisionOperation.Add, Name: name};
	tsService.addNewRevision(wbk, metaData);

After executing the example select the first series in the workbook, open the Revisions panel in the Series tab of the side panel. After this a new revision named New Revision appears in the beginning of the revisions list, date of this revision will correspond to the current moment.

See also:

TSService