You can use some of the embedded scripts in the Data Standard dialog to leverage some of the features found in PowerShell. By doing so, you can further customize the Data Standard dialog so that value updates are automated
Prop [ ] Function
Prop[ ] is an essential function for binding. With it you can access the properties of a file in Vault. If you want to map a text box to the property Engineer, write: <TextBox text="{Binding Prop[Engineer].Value}"/>. When the text box is created, Prop[ ] returns the value of that property. Every time the text box gets updated, it notifies the Prop[ ] function which writes the new value to the mapped file property.
Ps Function
There are three scripts that provide the connection between the dialog story and the PowerShell world. The difference between them is that they return different values.
The other three functions are PsCmd[ ], PsVal[ ] and PsList[ ] These three functions call the scripts/functions that are avaible in Data Standard. Data Standard loads all files it finds in the module folder and then Data Standard executes them using thes three Ps functions. This module folder is located at C:\ProgramData\Autodesk\Vault 2014\Extensions\DataStandard\Vault\addinVault. Only the .ps1 files in this folder are loaded. Data Standard does not look for subfolders.
PsCmd[ ] can only execute a script function. It does not return any values.
PsVal[ ] can execute a script function and returns strings.
PsList[ ] can execute a script function and returns an array of values.
EditMode and CreateMode
EditMode and CreateMode are boolean type functions that let you enable or disable UI-elements. These are boolean type functions.
For example:
<TextBox:Name="myTextBox"IsEnabled="{Binding CreateMode}"/>
or
<TextBoxx:Name="myTextBox"IsEnabled="{Binding EditMode}"/>
By binding scripts to functions, you can invoke events on changed fields in the Data Standard dialog. This binding ability creates many possibilities for customizing your dialog.
For example, you can hide and show advanced fields for special purposes. One scenario might be if a user creates a new file. You do not have to fill in the Company field. However, if the field is filled in, the Engineer or Designer's name field can display for additional user entry. Or the dialog can simply validate the inserted field values before the user clicks OK.
Data Standard has three system properties. They are read-only. If you use a binding on them, the binding is for only one direction (read only).
The system properties are:
You can connect these three system properties to obtain the whole path for a document, including the file name and extension.
Use "$dsDiag.inspect()" to create a window that shows you all variables with their containing members and values at that moment in your PowerShell script enviroment. This is a useful tool for debugging.