Configure Data Standard for Custom Objects

Configure creation dialogs and tabs to display custom object data.

Requirements

Configure Data Standard for Use with Custom Objects

By default, all three components are provided with Data Standard. These components are pre-configured to work with a custom object in Vault called CustomObject. You must create this custom object to begin using Data Standard with all custom objects.
Note: Context menu support for custom objects is only available if an existing custom object exists. The default custom object (CustomObject) must be created first before you can use Data Standard with other custom objects.

Create CustomObject

  1. Create a custom object in Vault and call it CustomObject.

    Note: See Custom Objects Administration for more information.
  2. Restart Vault.
    Note: You must restart the Vault Client to display Custom Objects tabs.
  3. Create a new custom object using the New command and name it anything you want.
  4. Right-click on the new custom object. The context menu now displays two new menu items.

Create Custom Object Menus for Data Standard

Custom Object menus are configured in the mymenu.mnu file. This file is located in the C:\ProgramData\Autodesk\Vault 2015\Extensions\DataStandard\Vault directory.
Note: Vault 2015 R2 users will find the file at C:\ProgramData\Autodesk\Vault 2015 R2\Extensions\DataStandard\Vault.

Modify the mymenu.mnu File

    There are two sections in the mymenu.mnu file where you can configure menu options. One section is for the menu option New. The other section is for the menu option Edit.

    New Menu Option

      item newCustomObject 
      {
      .....
      ...
       NavigationTypes = [{CustomObject}];
      ToolbarPaintStyle = TextAndGlyph;
       PSFile = "CreateCustomObject.ps1";
       Image="NewCustomObject.ico";
      }
      

    Edit Menu Option

      item editCustomObject 
      {
      ....
      .....
       NavigationTypes = [{CustomObject}];
       ToolbarPaintStyle = TextAndGlyph;
       PSFile = "EditCustomObject.ps1";
       Image="EditCustomObject.ico";
      }

    The syntax for both sections is the same as other menu items. However, the attribute NavigationTypes contains the name of the custom object that you want to support with specified menu option. The name of the custom object must be entered in curly brackets (e.g., {CustomObjectName}).

    By default, {CustomObject} is used. However, if you create a custom object with a different name, for instance MyCustomObject, then the NavigationTypes attribute value must match the name of that custom object {MyCustomObject}.

Modify the Create and Edit Custom Object Script Files

    The menu definitions in the mymenu.mnu file point to a PowerShell file called CreateCustomObject.ps1 or EditCustomObject.ps1, depending on the section. The script file for creating and editing custom objects is similar to scripts for creating and editing other objects, such as files and folders. However, the script for creating and editing custom objects contains two unique commands: GetCreateCustomObjectDialog and GetEditCustomObjectDialog.

    Similar to other scripts, the create and edit custom object scripts point to a related .xaml file. These scripts can be edited to point to other .xaml files.

    Here is an excerpt from the NewCustomObject.ps1 script.

    ....
    $dialog = $dsCommands.GetCreateCustomObjectDialog($id)
    $xamlFile = New-Object CreateObject.WPF.XamlFile "CustomEntityXaml", "%ProgramData%\Autodesk\Vault 2015\Extensions\DataStandard\Vault\Configuration\CustomObject.xaml"
    ....
    Note: Vault 2015 R2 users shuold use this path instead: C:\ProgramData\Autodesk\Vault 2015 R2\Extensions\DataStandard\Vault\Configuration.

Use the XAML Template to Create Custom Object Dialogs and Tabs

    The syntax for .xaml dialogs is the same as for other dialogs and tabs. For the create and edit dialog, a XAML template is provided with the CustomObject.xaml. You can use this dialog template to create your own custom objects.

    The folder for the custom object must be created in the C:\ProgramData\Autodesk\Vault 2015\Extensions\DataStandard\Vault\Configuration directory.
    Note: Vault 2015 R2 users will find the file at C:\ProgramData\Autodesk\Vault 2015 R2\Extensions\DataStandard\Vault\Configuration.
    By default a folder called CustomObject already exists. This folder is used for the standard custom object (CustomObject) you create when first configuring Data Standard for use with custom objects.
    For your own custom objects, copy and paste the CustomObject folder and rename it to the name of your custom object.
    Note: The folder name must match the name of the custom object.

    When Vault is restarted, the Data Standard dialog tabs will show the custom object name based on the XAML file in the custom object folder. By default, a XAML file called Datasheet.xml already exists. Use this file as a template for creating your custom object tabs.

    Note: See Anatomy of a .xaml File for more information.