AddChangeOrder
EventNames:
- AddChangeOrder_Restrictions 
- AddChangeOrder_Pre 
- AddChangeOrder_Post 
Parameters
| Type | Name | Description | 
|---|---|---|
| changeOrder | The changeOrder which should get / is added. | |
| files | The Files to be tracked by the Change Order. | |
| items | The Items to be tracked by the Change Order. | |
| attachments | Files to be attached to the Change Order. | |
| comments | Multiple comments for the ChangeOrder including there attached files. | |
| emails | Multiple emails to send out upon completion. | |
| bool | successful | Post: | 
Unexpected Behaviour
AddChangeOrder event is raised when clicking in Vault Client on New Change Order… -> Save.
Afterwards it fires EditChangeOrder.
No CommitChangeOrder is called.
The argument files contains only the files that are directly linked to the ChangeOrder, and not the primary-links of the linked Items!
The argument comments contains the newly added comments.
A negative Id value is returned in Pre events and even the values for all other properties except Subject (CO), Message and Attachments can only be retrieved in in Post events.
Examples:
AddChangeOrder_Restrictions:
Register-VaultEvent -EventName AddChangeOrder_Restrictions -Action 'RestrictAddChangeOrder'
function RestrictAddChangeOrder($changeOrder, $files, $items, $attachments, $comments, $emails) {
	#Write event code here
}
AddChangeOrder_Pre:
Register-VaultEvent -EventName AddChangeOrder_Pre -Action 'PreAddChangeOrder'
function PreAddChangeOrder($changeOrder, $files, $items, $attachments, $comments, $emails) {
	#Write event code here
}
AddChangeOrder_Post:
Register-VaultEvent -EventName AddChangeOrder_Post -Action 'PostAddChangeOrder'
function PostAddChangeOrder($changeOrder, $files, $items, $attachments, $comments, $emails, $successful) {
	#Write event code here
}