Display Prompts during workflows

Display Prompts during workflows

Anonymous
Not applicable
425 Views
1 Reply
Message 1 of 2

Display Prompts during workflows

Anonymous
Not applicable

Hi,

 

When working with the Vault API I would like to get the prompts that comes with it. For instance when checking out a file (see the code below), I would expect a prompt to be displayed if for instance the  local file is newer than than the one in the vault and is about to be overwritten:

File '{0}' is NEWER than the data in the Vault. Are you sure you want to overwrite it?

 

 

VDF.Vault.Settings.AcquireFilesSettings settings = new VDF.Vault.Settings.AcquireFilesSettings(connection);
if (!file.IsCheckedOut)
{
settings.DefaultAcquisitionOption = VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Checkout;
settings.OptionsResolution.ForceOverwrite = false;
settings.AddEntityToAcquire(file);

VDF.Vault.Results.AcquireFilesResults results = connection.FileManager.AcquireFiles(settings);

}

 

Thanks....

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

smithmat
Autodesk
Autodesk
Accepted solution

You'll want to explore using either:

  • Autodesk.DataManagement.Client.Framework.Vault.Forms.Settings.InteractiveAcquireFileSettings or
  • Autodesk.DataManagement.Client.Framework.Vault.Forms.Settings.ProgressAcquireFilesSettings

 

Either of these can be passed to

  • Autodesk.DataManagement.Client.Framework.Vault.Forms.Library.AcquireFiles

Notice: the above AcquireFiles method is a different one than you are currently using.  The one you are currently using display no UI, while the ones above do display UI.

 

Using InteractiveAcquireFilesSettings will display the Get/Checkout dialog that you see in Vault.

Using the ProgressAcquireFilesSettings will not display that dialog, but will display other relevant UI (progress dialog, restriction dialogs, error dialogs).  I think this is the one you are looking for.

0 Likes