- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We are using Web Services API - Vault Professional 2025.3 to add and update an item with the following code:
Public Function AddItem(vf As VaultedFile, catID As Long) As Item
Dim item As Item = wsm.ItemService.AddItemRevision(catID)
item = wsm.ItemService.EditItems(New Long() {item.RevId})(0)
If item.Locked = False Then
' set the needed information
item.Title = vf.WorkFile.Name
item.Detail = vf.WorkFile.Name
' save the item revision
Try
wsm.ItemService.UpdateAndCommitItems(New Item() {item})
Catch ex As Exception
Dim eh As New ErrorHandler(ex, "Error creating Item:", vf)
eh.QuietlyHandleIt()
End Try
End If
Return item
End FunctionIt works fine on a clean test vault, and even my home production vault. However on a certain server with a certain vault it fails everytime, because the SP (watched with SQL Profiler) received IMItemNumber=default instead of a value like = "00000023". This happens exactly on the line UpdateAndCommitItems(), which returns SOAP error 1306. I checked EVERY single line of custom configuration, I removed (since we have a prod and test version that both show the error) every single piece of behavior customization that could effect items (LifeCycles, Revisions, Categories, Rule, Naming, Property Mappings). Problem persists in these specific vaults. I thought I could outsmart the issue by copying a bad vault's configuration to a clean vault, but the problem did NOT reproduce itself after that. It also doesn't matter the file I use. All files fail or All files pass depending on the vault database i'm logged into (even a good database on the same ADMS server with the bad ones).
Production 3 server replicated ADMS:
Bad Vaults:
- Prod - One old database (migrated from as far back as 2018),
- Prod Test - one new database (pulled config from migrated one, after installed clean, and then tested upon).
Good Vaults:
- Clean - One new database (pulled no configs)
Home based simple ADMS:
Good Vaults:
- Personal - One old database (migrated from 2020),
- Test - one new database (used config from bad database above)
Below is the profiler's capture of the command to UpdateItem that caused the error. Notice the @IMItemNumber=default. This is the behavior causing the error. I can't find what is making it do that.
exec UpdateItem @IITID=7483849,@IITDetail=N'H7TEST-2101-01E06.ipt',@IITUnits=N'Each',@ITComment=N'',@IRID=1680587,@IMID=7483848,@IMItemNumber=default,@IMTitle=N'TEST.ipt',@updateUserID=10119,@loginSession='4BAEBA4B-9EC9-42FE-A40A-893628B5084F',@UoMID=1,@BOMStructID=1,@commitChanges=1,@createDate='2025-06-09 05:10:44.400'
I'm stumped, any help would be nice.
Thank you,
jvj
Solved! Go to Solution.