Quintiq file version 2.0
#parent: Toolbar/DataHolderDirectoryFileItem
Response OnCreated () id:Response_Toolbar_DataHolderDirectoryFileItem_OnCreated
{
  #keys: '[108684.0.1769381998]'
  Body:
  [*
    // Set last used directory
    lastUsed3DDriveDirectory := guard( DataHolderLastSelected3DDriveDirectory.Data().Copy(), null( FileItem, owning ) );
    
    // Need to validate that the directory still exists with same name as the fileitem is mapped by Key and object does not support checking if it exists
    if( not isnull( lastUsed3DDriveDirectory ) )
    {
      try 
      {                           
        url := lastUsed3DDriveDirectory.URL();
        fileProvider := FileProvider::CreateFromURL( lastUsed3DDriveDirectory.URL() );
        lastUsed3DDriveDirectory := fileProvider.CreateFileItemFromURL( url );
        this.Data( &lastUsed3DDriveDirectory );
      }
      onerror
      {
        // Reset the last used drive
        this.ClearData();
      }
    }
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_GUIComponent_OnCreated'
}
