I have a client on 2013 R2 who uses Vendor Notes a lot. The problem is that they cannot see this note in PM Transaction Entry. I thought I would follow the instructions that Mariano Gomez wrote for adding the Item note, just changing the field and window names. But it doesn't seem to work for me. This was his post.
http://dynamicsgpblogster.blogspot.co.uk/2008/09/how-to-display-existing-record-notes-on.html
My code is below. When I select a Vendor the icon does not change to yellow to show there is a note (one does exist). Then if I click the note icon it says ' this record has been created since your attempt to create it'. It then shows the note fine.
Any ideas gratefully received!
' -------------------------------------------------------------------------------------- ----------------------
' ADD VENDOR NOTE RECORD - Payables Txn Entry Window
' ------------------------------------------------------------------------------------------------------------
Private Sub Window_BeforeOpen(OpenVisible As Boolean)
Call VendorNoteShowHide_AfterUserChanged
End Sub
Private Sub VendorNumber_Changed()
Call VendorNoteShowHide_AfterUserChanged
End Sub
Private Sub RecordNoteAbsent_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
' Dim CompilerApp As New Dynamics.Application
Dim CompilerApp As Object
Dim NoteIndex As Long
Set CompilerApp = CreateObject("Dynamics.Application")
If Not CreditorID.Empty Then
NoteIndex = CompilerApp.GetDataValue("'Note Index' of table PM_Vendor_MSTR of form PM_Transaction_Entry")
Else
NoteIndex = 0
End If
Call Note_Button(NoteIndex, CreditorID)
End Sub
Private Sub RecordNotePresent_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
'Run the note absent script
Call RecordNoteAbsent_BeforeUserChanged(KeepFocus, CancelLogic)
End Sub
Private Sub VendorNoteShowHide_AfterUserChanged()
' Dim CompilerApp As New Dynamics.Application
Dim CompilerApp As Object
Dim NoteIndex As Long
Set CompilerApp = CreateObject("Dynamics.Application")
If Not CreditorID.Empty Then
NoteIndex = CompilerApp.GetDataValue("'Note Index' of table PM_Vendor_MSTR of form PM_Transaction_Entry")
Else
NoteIndex = 0
End If
Call RecordNoteShowHide(NoteIndex)
End Sub
Private Sub RecordNoteShowHide(IN_NoteIndex As Long)
' Dim CompilerApp As New Dynamics.Application
Dim CompilerApp As Object
Dim CompilerMsg As String
Dim CompilerError As Integer
Dim CompilerCmd As String
Dim l_result As Integer
CompilerCmd = ""
CompilerCmd = CompilerCmd & "call Check_For_Record_Note,"
CompilerCmd = CompilerCmd & Str(IN_NoteIndex) & ","
CompilerCmd = CompilerCmd & " '(L) Vendor Note Show Hide' of window PM_Transaction_Entry of form PM_Transaction_Entry;"
CompilerCmd = CompilerCmd & "if '(L) Vendor Note Show Hide' of window PM_Transaction_Entry of form PM_Transaction_Entry = 1 then"
CompilerCmd = CompilerCmd & " hide '(L) RecordNoteAbsent' of window PM_Transaction_Entry of form PM_Transaction_Entry;"
CompilerCmd = CompilerCmd & " show '(L) RecordNotePresent' of window PM_Transaction_Entry of form PM_Transaction_Entry;"
CompilerCmd = CompilerCmd & "else"
CompilerCmd = CompilerCmd & " show '(L) RecordNoteAbsent' of window PM_Transaction_Entry of form PM_Transaction_Entry;"
CompilerCmd = CompilerCmd & " hide '(L) RecordNotePresent' of window PM_Transaction_Entry of form PM_Transaction_Entry;"
CompilerCmd = CompilerCmd & "end if;"
Set CompilerApp = CreateObject("Dynamics.Application")
CompilerApp.CurrentProductID = 0 ' DYNAMICS
CompilerApp.CurrentProduct = CompilerApp.CurrentProduct & "!Modified"
CompilerError = CompilerApp.ExecuteSanscript(CompilerCmd, CompilerMsg)
If CompilerError <> 0 Then
l_result = MsgBox(CompilerMsg, vbOKOnly, "Dexterity Compiler")
End If
End Sub
Private Sub Note_Button(IN_Note_Index As Long, IN_CreditorID)
' Dim CompilerApp As New Dynamics.Application
Dim CompilerApp As Object
Dim CompilerMsg As String
Dim CompilerError As Integer
Dim CompilerCmd As String
Dim l_result As Integer
' Pass-through sanScript code to be compiled by the
CompilerCmd = ""
CompilerCmd = CompilerCmd & "call Note_Button,"
CompilerCmd = CompilerCmd & """" & IN_CreditorID & ""","
CompilerCmd = CompilerCmd & " """", {form display name}"
CompilerCmd = CompilerCmd & " true, {record note button}"
CompilerCmd = CompilerCmd & " 15760, {A Creditor ID must be entered before you can add a note.}"
CompilerCmd = CompilerCmd & Str(IN_Note_Index) & ","
CompilerCmd = CompilerCmd & " 'Vendor ID' of window PM_Transaction_Entry of form PM_Transaction_Entry, {field with the record note}"
CompilerCmd = CompilerCmd & " table PM_Vendor_MSTR, {file with the record note}"
CompilerCmd = CompilerCmd & " '(L) Vendor Note Show Hide' of window PM_Transaction_Entry of form PM_Transaction_Entry;"
Set CompilerApp = CreateObject("Dynamics.Application")
CompilerApp.CurrentProductID = 0 ' DYNAMICS
CompilerApp.CurrentProduct = CompilerApp.CurrentProduct & "!Modified"
CompilerError = CompilerApp.ExecuteSanscript(CompilerCmd, CompilerMsg)
If CompilerError <> 0 Then
l_result = MsgBox(CompilerMsg, vbOKOnly, "Dexterity Compiler")
End If
End Sub
*This post is locked for comments