Skip to content

Loading a script for non virtual entities

When the Solution is deployed, a set of objects are installed which are contained in a contract layer on top of each supported data source database or smart view involved in the solution in order to retrieve data to be loaded in the Manufacturing Data Warehouse. These objects have been modeled according to a standard data storage pattern that takes for granted that specific data has been saved in given tables within the databases. If, due to particular project requirements, data has been stored in different tables, it is necessary to manually modify the relative objects in order to correctly retrieve data in the MDW.

This can be done by either specifying a SELECT statement or by using a stored procedure.

You can load three types of scripts:

  • "Load Script": to load data on the Manufacturing Data Warehouse.
  • "Delete Script": to delete data from the Manufacturing Data Warehouse.
  • "Localize Script": to load localized data.

If you have created extensions for your project, you need to load custom scripts to retrieve data from the database.

Only advanced users should perform this operation.

Procedure

  1. In the Databases page, select a database.
  2. Click "Open Database".
  3. In the "Scripts" page, click "Create Script".
  4. In the "Models" drop-down list, select "Custom Model".
  5. In the "Model Entities" drop-down list, select one of the extensions you have previously configured.
  6. From the "Entity Script Type" drop-down list box, select one of the following options depending on previously-selected fields: "Load Script", "Delete Script", "Localize Script". This procedure is valid for deleted and localized scripts as well.
  7. From the "Script Type" drop-down list box, select either "View" (default setting) or "Stored Procedure". This box is enabled only for the extensions for which you have selected a Large granularity and only if an OOTB script has not been provided.
  8. A script template is shown: depending on the script type you have selected, you can edit either the script or the stored procedure.
  9. Add a FROM clause to specify the source database from where you want to retrieve data. 
  10. Add the mapping for the fields.
  11. Click "Save".
  12. Click "Show Original" to view the original script next to the one you are editing.

Notes

  • Do not modify field names and types, otherwise the deploy operation may not be completed correctly.
  • If you are loading data from a third-party database and the "Smart Time Window Enabled" checkbox has been selected, the "RowInserted" column must always contain a value, otherwise data flows may not be completed correctly.

Editing scripts to retrieve context data for entities generated by a smart view

If you have added contexts to a smart view, you must edit the SQL script to retrieve their values in the MDW.

  1. In the "Models" drop-down list, select the smart view for which you have added custom contexts.
  2. In the "Model Entities" drop-down list, select one of the facts to which you have added custom contexts. Please note that this list includes all the entities for that smart view, including those you have selected for contexts.
  3. Edit the script according to your requirements.
  4. Click "Save".

Note

It is highly recommended that you only edit the script when you are totally sure that the smart view configuration has been completed, because when a smart view is modified, it is deleted and created again. As a result, if you have already edited the script and then modify the smart view, your changes to the script may not be maintained.

To prevent errors, make sure that the script is still correct after you have modified the smart view and if that is not the case, merge the original script with the one you modified.


Last update: October 26, 2026