Changing File Category when using AddUploadedFile() Method

Changing File Category when using AddUploadedFile() Method

Darrell.johnson
Enthusiast Enthusiast
267 Views
1 Reply
Message 1 of 2

Changing File Category when using AddUploadedFile() Method

Darrell.johnson
Enthusiast
Enthusiast

How do I change the Category of a File respectively don't use the Default Category when I use the AddUploadedFile() Method?

 

Darrelljohnson_0-1721129359947.png

 

 

This is the code I am using:

Sub Main
	AddFile(oVaultConnection.WebServiceManager, vaultName, directoryId(0), filename & ".pdf", "this File was checked in automatically", System.DateTime.Now, Nothing, Nothing, Nothing, False, contentArrayPdf)
End Sub

	Public Shared Function AddFile(mgr As WebServiceManager, vaultName As String, folderId As Long, fileName As String, comment As String, lastWrite As DateTime, _
	associations As FileAssocParam(), bom As AWS.BOM, fileClassification As FileClassification, hidden As Boolean, fileContents As Byte()) As AWS.File

	Dim uploadTicket As ByteArray = UploadFile(mgr, fileName, fileContents)

	Dim addedFile As AWS.File = mgr.DocumentService.AddUploadedFile(folderId, fileName, comment, lastWrite, associations, bom, _
		fileClassification, hidden, uploadTicket)

	Return addedFile
	End Function

 

0 Likes
268 Views
1 Reply
Reply (1)
Message 2 of 2

Nick_Hall
Collaborator
Collaborator

Hi Darrell

 

As far as I know, there is no way of bypassing the Category assignment rules on check-in.

 

You might be able to use the technique described here to create suitable assignment rules that are processed first.

 

https://www.cadlinecommunity.co.uk/hc/en-us/articles/5705497576093-Vault-Data-Standard-Category-assi...

 

I've not tried this, but I think you would have to

  • Write a value to a file property before checking it in
  • Configure Vault to map the property
  • Set up the rules to act on that property

I have to do some testing with property mappings this week, so I'll test it out then.

 

Hope that helps

Nick

 

0 Likes