Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Need an event in C# that refreshes grid prior to code being called using GP

Posted on by 75,730

I have a C# application that creates a class library that gets included into GP. Many of the screens are wrapped around various distribution windows. I proceed through these windows as you can see in the included code. An issue that has come up is that if a user changes a value on a distribution line but does not move off that line when the event fires that brings up my code, the value read on the line is the old value. Is there some event I can use in my code to refresh the grid prior to my code firing?

SampleCode.txt

Categories:
  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,926 Most Valuable Professional on at
    RE: Need an event in C# that refreshes grid prior to code being called using GP

    Hi Richard

    You would need to use passthrough Dexterity to pull the focus. Or use the Visual Studio Integration Toolkit helper functions, which is web client compatible.

    Dexterity command: Window_PullFocus()

    Using the Dynamics.Application for passthrough does not work on web client.

    You could try using VST commands to move focus to the save button but it might not do what you need.

    Regards

    David

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Need an event in C# that refreshes grid prior to code being called using GP

    Thanks Andrea, these descriptions concern me. In my case, a distribution grid will be displayed with distributions so there are times that no database values are on the lines. Then the user comes along and enters a GL account but does not leave the line. I am hoping the "Keep Changes" setting is what I seek.

  • Suggested answer
    Andrea Melroe Profile Picture
    Andrea Melroe 3,437 on at
    RE: Need an event in C# that refreshes grid prior to code being called using GP

    Hi Richard,

    Have you looked at using something like the Refresh method?

    Here's a link to a C# example of this:

    docs.microsoft.com/.../system.data.linq.refreshmode

    I'm definitely not a C# expert, but I hope this helps and that others in the community have some suggestions for you.

    Thanks Richard,

    Andrea Melroe  | Sr. Technical Advisor | Microsoft Dynamics GP

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans