Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP forum
Answered

Scrolling window range not functioning using VS C#

Posted on by 75,730

I have this code that loops through the GL Inquiry scroll window. I just happened to stumble across a recurring GL entry the is posted each month. The entries consists of 3 distribution lines. What makes each posting unique is the date and RecurringTrxSequence. So I pass all these values down and set the beginning and ending range but much to my surprise the loop goes through all 36 distributions crossing dates. I am using key 8 which matches these values. On the screen is only the three for each month. What am I missing to restrict it to just the three distributions for each date?

                        Microsoft.Dexterity.Applications.DynamicsDictionary.GlYtdTrxOpenTable GLDistTable;
                        GLDistTable = Dynamics.Tables.GlYtdTrxOpen;

                        GLDistTable.Key = 8;
                        GLDistTable.RangeClear();

                        GLDistTable.Clear();
                        GLDistTable.JournalEntry.Value = JournalNumber;
                        GLDistTable.OpenYear.Value = TrxYear;
                        GLDistTable.TrxDate.Value = TrxDate;
                        GLDistTable.RecurringTrxSequence.Value = RecurringTrxSequence;
                        GLDistTable.RangeStart();

                        GLDistTable.Fill();
                        GLDistTable.JournalEntry.Value = JournalNumber;
                        GLDistTable.OpenYear.Value = TrxYear;
                        GLDistTable.TrxDate.Value = TrxDate;
                        GLDistTable.RecurringTrxSequence.Value = RecurringTrxSequence;
                        GLDistTable.RangeEnd();

                        err = GLDistTable.GetFirst();
                        while (err != TableError.EndOfTable)
                        {

                              Do work

                        }

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Scrolling window range not functioning using VS C#

    Wow, talk about needing to take a break. Right there in my notes I wrote down index 10 yet somehow in my code it is 8. Thanks for a second set of eyes.

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,837 Moderator on at
    RE: Scrolling window range not functioning using VS C#

    Richard Wheeler

    When you set an indexed range you must populate the fields for the key you are using.  Looking at the fields you are using, you should be using key 10 not key 8. See screenshot from GP Power Tools Resource Information.

                            GLDistTable.Key = 8;

    Should by

                            GLDistTable.Key = 10;

    Resource-Info.png

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans