Use deleteVersion API

As an application designer or story developer, you can use the deleteVersion API for deleting a public or private version.

Before You Start

Before using the deleteVersion API, make sure that you've checked the following:
  • You've created an application or optimized story that contains a table and SAP Analytics Cloud planning model.

  • You've assigned the planning model to the table.

  • You've made up your mind on how you to visualize or expose the deleteVersion API to the end users.

Example

The following script shows how you can use the deleteVersion API for deleting a specific version:
Sample Code
// delete private version "actualPrivateVersionToDelete"
var versionToDelete = Table_1.getPlanning().getPrivateVersion("actualPrivateVersionToDelete");
if (versionToDelete ) {
    versionToDelete.deleteVersion()
};