Deployment Scripts allow the Modeler to customize the deployment process by issuing a set of XMLA, MDX, or SQL commands upon each Deploy to OLAP action.
We can use the Deployment Script feature to automate certain tasks such as:
- Dynamically updating the Current Month variable
- Auto-validating and correcting Dimension attribute values
- Syncing data such as exchange rates from source system
By default, Applications have the Process OLAP Deployment Script, which generates and processes your solutions.
How to Create a Script
We will explain how to use a script to dynamically update the Current Month variable. If you are not familiar with variables, refer to this article.
1. In the Modeler, select the Scripts node under Deployment.
2. Click Add.
3. Give the script a name, select its type, and click Save.
4. Click Edit and write the script definition.
5. Click Save .
Deployment Scripts will run every time we deploy an Application. Please note, the script order determines the sequence of execution. Click the Move up and Move Down arrows to adjust the script order as necessary.
Note: You should always put the Process OLAP script at the bottom of the list, to ensure it runs at the end.