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

Notifications

Announcements

No record found.

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,848 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:
I have the same question (0)
  • 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,848 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,093 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 540 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans