Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Adding Notes Icon to PM Transaction Entry Window

Posted on by 149

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

  • Sue Westlake Profile Picture
    Sue Westlake 149 on at
    RE: Adding Notes Icon to PM Transaction Entry Window

    I have made progress by changing this line:

    Private Sub VendorNumber_Changed() to Private Sub CreditorID_Changed() so it works fine now when adding new invoices.

    I am now only having a problem when I use the voucher no lookup to review the invoices, then it does not display the note when one is attached or shows the wrong note.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans