- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I tried to update Thumbnail property for an Item and i get an error 3933. Is it possible to update this property if it's a System property?
This is what i tried:
VDF.Vault.Currency.Properties.ThumbnailInfo thumbnailInfo = new VDF.Vault.Currency.Properties.ThumbnailInfo(VDF.Vault.Currency.Properties.ThumbnailInfo.ThumbnailType.Thumbnail, System.IO.File.ReadAllBytes(selectedFile));
PropDef[] AllProperties = m_serviceManager.PropertyService.GetPropertyDefinitionsByEntityClassId(VDF.Vault.Currency.Entities.EntityClassIds.Items);
PropDef thumbnailPropDef = AllProperties.FirstOrDefault(x => x.DispName == VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.ThumbnailSystem);
PropInst[] PartThumbnailPropInt = connection.WebServiceManager.PropertyService.GetProperties(VDF.Vault.Currency.Entities.EntityClassIds.Items, new long[] { part.Id }, new long[] { thumbnailPropDef.Id });
List<PropInstParam> propinstparams = new List<PropInstParam>()
{
new PropInstParam(){Val = thumbnailInfo.Image, PropDefId = thumbnailPropDef.Id }
};
var myPropInstParamArray = new PropInstParamArray() { Items = propinstparams.ToArray()};
List<long> editItemids = new List<long>();
try
{
Item[] editableItems = m_serviceManager.ItemService.EditItems(new long[] { part.RevId});
editItemids = editableItems.Select(x => x.Id).ToList();
long[] _masterIds = editableItems.Select(x => x.RevId).ToArray();
Item[] updatedItems = connection.WebServiceManager.ItemService.UpdateItemProperties(_masterIds, new PropInstParamArray[] { myPropInstParamArray });
connection.WebServiceManager.ItemService.UpdateAndCommitItems(updatedItems);
}
catch (Exception)
{
connection.WebServiceManager.ItemService.UndoEditItems(editItemids.ToArray());
}
Olivier.
Solved! Go to Solution.