Skip to content

Loading a script for virtual custom entities

You can provide a script for the creation of the view related to the virtual custom entity.

For virtual custom entities, the only available script type is "Load Script".

Only advanced users should perform this operation.

Procedure

  1. In the Databases page, select the Destination Server database (MDW cloud).
  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 virtual extensions you have previously configured. A script template is shown.
  6. Provide a script by reading data from the Manufacturing Data Warehouse.
  7. Add the mapping for the fields. Do not modify field names and types, otherwise the deploy operation may not be completed correctly.
  8. Click "Save".
  9. Click "Show Original" to view the original script next to the one you are editing. The NameId field must be unique for each row returned by the script.

Example

In this example, we combine information about work order operations and related work orders into a single view.

SELECT 
    CAST(ore.OperationResponseId AS nvarchar(255)) AS [OperationResponseExtendedId],
    CAST(ore.OperationResponseKey AS nvarchar(255)) AS [OperationExecutionKey],
    CAST(ore.[Name] AS nvarchar(255)) AS [OperationExecutionName],
    CAST(oex.OperationExecutionKey AS nvarchar(255)) AS [OperationResponseKey],
    CAST(oex.[Name] AS nvarchar(255)) AS [OperationResponseName]
FROM
    [bm20].[OperationResponse] ore
    INNER JOIN [bm20].[OperationExecution] oex
        ON ore.OperationExecutionId = oex.OperationExecutionId

Last update: October 26, 2026