Vault API – Yes/No in the "Restrictions Found" dialog

By Marat Mirgaleev

Issue

I’ve created a very simple code that shall block all attempts to add files to Vault:

public void OnLoad()        {          DocumentService.AddFileEvents.GetRestrictions +=                 new EventHandler(                              AddFileEvents_GetRestrictions);        }             void AddFileEvents_GetRestrictions(object sender,                                            AddFileCommandEventArgs e)        {          e.AddRestriction(                   new ExtensionRestriction(e.FileName, "Error..."));        }      }

It works as expected – it shows this dialog:

_AddFileBlocked

and doesn’t add the file.

But could you describe the difference between the Yes and No buttons here, please?

Solution

In Vault a number of files can be added at once and, when some restriction is raised, this dialog is shown with a “Do you want to continue?” question. So, this prompt is whether or not you want to cancel any remaining work or to continue execution. I.e. if you’ve selected multiple files to add, choosing “Yes” will continue to attempt to add any remaining files.


Comments

One response to “Vault API – Yes/No in the "Restrictions Found" dialog”

  1. What is the point in restrictions then, when the user can override it easily by clicking on the yes button.
    I have the simillar situation. Where I need to get user logins before changing lifecycle. how do i stop the user from change lifecycle when the login fails.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading