- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am working on some custom routines for a client and trying to use the data standard.
They are currently on a different document management system and preparing to switch and want the same functionality they previously had.
Part of this is being able to update specific properties on selection of documents at the same time.
I have used the Data standard created Custom Command / Custom PS1 / Custom XAML I have been able to work through everything except actually applying the updates to the additional files.
Here is my code I am currently using
$vaultContext.ForceRefresh = $true
$dialog = $dsCommands.GetEditDialog($fileId)
$xamlFile = New-Object CreateObject.WPF.XamlFile "UpdateProjectInfoxaml", "UpdateProjectInfo.xaml"
$dialog.XamlFile = $xamlFile
$result = $dialog.Execute()
if ($result)
{
$ids = @()
$propDefIds = @()
$propVals = @()
foreach ($prop in $dialog.ViewModel.Properties)
{
switch($prop.Name)
{
{ ($_ -eq "ProjectStatus") } # syntax for adding multiple conditions -or ($_ -eq "ProjectSupervisor") }
{
$propDefIds += $prop.Id;
$propVals += $prop.Value;
}
}
}
# just realized add check to not include current file Id in list of Id's
foreach ($file in $vaultContext.CurrentSelectionSet)
{
$ids += $file.Id
}
$dsDiag.Inspect()
# Update Files
# $vault.documentservice.UpdateFileProperties($Ids, $propDefIds, $propVals, "Property Update");
}
The last actual line is where I am having difficulties calling the UpdateFileProperties
I will probably need to do the following CheckOutFiles / UpdateFilesProperties / CheckInFiles or is there a better method for this through your data standard.
Any sample would be appreciated.
Thanks
Solved! Go to Solution.