Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Scrolling window range not functioning using VS C#

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

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

                        }

Categories:
  • Richard Wheeler Profile Picture
    Richard Wheeler 75,788 Moderator 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,965 Most Valuable Professional 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

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,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans