Is there a way to access the _conisioComment_ (state change comment) and _conisioNotComment_ (notification comment) in an add-in (VB.net) without using SQL?
I wrote an add-in that dynamically notifies a user whose name is in a specific field of a document when the state is changed (post-state hook), but I don't have a way to make the comments show in the new email. If I want to use SQL for this (trying to avoid it for now) I can get the State Change Comment from the TransitionHistory table, but I don't know of where the Notification Comment is stored.
I tried looking into getting all the state change message information at once using the message table, but it looks like not all messages can be found there. I think it's only messages in the internal messaging system but not using smtp. Please correct me if I'm wrong on this one.
Edit: I found the information (in SQL anyway) that I was looking for, but it's in the TmpTransitionHistory table and is only found during the transition, so I don't think accessing that is going to be reliable.
Still hoping there's a way to do this without sql, but it's looking doubtful.
Tara, I used PDM API. Here is code.
Select Case poCmd.meCmdType
Case EdmCmdType.EdmCmd_PostState
Dim inboxVault As IEdmVault8 = New EdmVault5
If inboxVault Is Nothing Then
inboxVault = New EdmVault5()
End If
'Log into vault as user with database notifications
inboxVault.Login("username", "password", "vaultname")
End If
'Declare an IEdmUserMgr5 object
Dim userMgr As IEdmUserMgr5
userMgr = inboxVault
user = userMgr.GetLoggedInUser
Debug.Print(user.Name)
For Each AffectedFile In ppoData
Dim inbox As IEdmInbox5 = DirectCast(user, IEdmInbox5)
'Get first text message in inbox
Dim message As IEdmMessage5
Dim pos As IEdmPos5
pos = inbox.GetFirstMessagePosition(EdmGetMsgFlag.EdmGetMsg_Notifications)
Dim vault As EdmVault5
Dim msg As String = ""
vault = poCmd.mpoVault
message = inbox.GetNextMessage(pos)
Dim messageDate As String
messageDate = message.Date
If Not message.IsRead Then
msg = "Sender name = " + message.SenderName + vbLf +
"Is read = " + message.IsRead.ToString + vbLf +
"Type = " + message.MessageType.ToString + vbLf +
"Date = " + messageDate + vbLf +
"Subject = " + message.Subject + vbLf +
"Body = " + message.Body + vbLf
message.Remove()
vault.MsgBox(poCmd.mlParentWnd, msg)
End If
Next
End Select