Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

VBA on window does not work when using navigation lists

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

I have put a VBA customisation on the Sales Transaction Entry window so that when on Fulfilment Order you select 'Confirm Ship' and it transfers to invoice, the document date updates to the current date.

Private Sub TypeTypeID_Changed()

If Me.TypeTypeID = "4" Then DocDate = Date
End

End Sub


This works perfectly fine with the window open, but as we have large amounts of sales transactions the confirm ship is often done in bulk using navigation lists. The document date does not update. If you open up the invoice from here it updates, but they just post the batch.

I am aware there is an option in the sales document setup to update invoice date on print, but as I mentioned they do not print. Printing is done in bulk the next date based on the previous days document date via Print Sales Documents.


Does anybody have any suggestions on how to get this to work with navigation lists too?

Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: VBA on window does not work when using navigation lists

    Thanks for the responses. I agree that a trigger is a good solution. Whilst I understand what a trigger is and does, this is a bit beyond my skill level (I'm sure I could figure it out but don't want to go playing around with something like this and no get it right). I will likely contact a consultant to customise.

    Thankyou

  • Verified answer
    chadbruels Profile Picture
    chadbruels 1,584 on at
    RE: VBA on window does not work when using navigation lists

    It is highly likely that from the navigation lists the code does not run that your custom VBA change triggers from. Turn on Debugging in the Dex.ini and capture a script (Debug > Log Scripts) when it works in the window and capture another script when processed from the nav list. Comparing them will likely show a different logic path in each. You will probably need to write a Dexterity customization containing a trigger on a procedure you identify in the nav list logic path.

    In case you are thinking of a database trigger, I would recommend against it in this situation. You would not wish to update the Doc Date on every update to the table record, and a database trigger will lack the situational awareness that triggering on a specific procedure will.

  • Suggested answer
    RE: VBA on window does not work when using navigation lists

    I'd use a trigger instead.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,401 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans