web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

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

(0) ShareShare
ReportReport
Posted on by 75,854 Moderator

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
    Andrea Melroe Profile Picture
    3,437 on at

    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

  • Richard Wheeler Profile Picture
    75,854 Moderator on at

    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
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,157 Most Valuable Professional on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 528 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 455 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 376

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans