Get restrictions on Assign / Update Item

Get restrictions on Assign / Update Item

GabrieleZelasco
Enthusiast Enthusiast
230 Views
1 Reply
Message 1 of 2

Get restrictions on Assign / Update Item

GabrieleZelasco
Enthusiast
Enthusiast

Good morning everyone,
in our solution (c#, Vault2023) I need to intercept the assign/update article call made by Vault 2023 starting from a cad file (by api of course).


In the event where I intercept the call, I should check the Part Number property if it meets certain requirements before the item is created and associated with the file.

 

If it does not meet these requirements, I would like to block the creation of the item adding restriction.
I have tried ItemService.PromoteItemEvents.GetRestrictions but it crashes the Vault, I assume because it works when updating an item and not a file.

 

Can anyone tell me which event or workaround I can use to achieve this ?

Thank you very much

0 Likes
Accepted solutions (1)
231 Views
1 Reply
Reply (1)
Message 2 of 2

GabrieleZelasco
Enthusiast
Enthusiast
Accepted solution

Hi all. I was wrong about the ExtensionRestriction constructor:
public ExtensionRestriction(System.string objectName,System.string message)

If objectName is null then Vault crashes.


ItemService.PromoteItemEvents.GetRestrictions is what I needed.

It works starting from File and Item both.


I apologize. Thanks to all

0 Likes