AddItem

EventNames:

  • AddItem_Restrictions

  • AddItem_Pre

  • AddItem_Post

Parameters

Type

Name

Description

Item

item

The item which should get / is added.

Restrictions and Pre:
In Restrictions and Pre you have very limited data, because the item does not exist so far.
Only the property _NewCategoryName is set as long as a valid category Id was passed.

Post:
In POST you have a full powerVaultItem object available, because at this point the item exists.

bool

successful

Post:
The information whether the Web Service call was successful or not is only available in Post events.

Unexpected Behaviour

AddItem event is raised when clicking in Vault Client on New Item… -> Selecting Category -> Ok.
Therefore you have only the data about the selected Category available and seriously not more.

Examples:
AddItem_Restrictions:

Register-VaultEvent -EventName AddItem_Restrictions -Action 'RestrictAddItem'

function RestrictAddItem($item) {
	#Write event code here
}

AddItem_Pre:

Register-VaultEvent -EventName AddItem_Pre -Action 'PreAddItem'

function PreAddItem($item) {
	#Write event code here
}

AddItem_Post:

Register-VaultEvent -EventName AddItem_Post -Action 'PostAddItem'

function PostAddItem($item, $successful) {
	#Write event code here
}