Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Scrolling window range not functioning using VS C#

(0) ShareShare
ReportReport
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

                        }

Categories:
  • 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,932 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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans