Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Get data tables names associated with a grid?

Posted on by 75,730

Is there any way to get the name of the data table associated with a grid on screens? For example, I go to Inquiry->Sales->Transactions but Customer. I enter a customer and then highlight a document. I then zoom to the document and then click on Distributions. On the screen will be a grid with the distributions. I believe what is behind that grid is called a data table.  Sometimes when am I coding in C# the names that pop up are somewhat misleading. Using Forms Modifier does not tell you the object name. Is there is a programmer's reference to those names that would be great to know how to obtain that reference.

Categories:
  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,915 Most Valuable Professional on at
    RE: Get data tables names associated with a grid?

    Hi Richard

    These are the Visual Studio equivalents of setting an Indexed range in Dexterity.

    Look in the Visual Studio Tools for Microsoft Dynamics GP Programmers Guide, Chapter 9

    "C:\Program Files (x86)\Microsoft Dynamics\GP2018 VS Tools SDK\VSTDGPProgrammersGuide.pdf"

    You could also look in the Dexterity manuals

    https://winthropdc.wordpress.com/training/

    Here are some articles as well:

    https://winthropdc.wordpress.com/2018/02/21/dexterity-future-proof-range-setting/

    https://winthropdc.wordpress.com/2018/02/26/dexterity-well-behaved-ranges/

    Regards

    David

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Get data tables names associated with a grid?

    Do you know I can find documentation on commands for these data tables within a scrolling window.  I used to have if but I can no longer find it. I want to research fine tuning some of my code. I am looking for documentation on commands such as the ones below.

                           Microsoft.Dexterity.Applications.DynamicsDictionary.RmDistributionHistoryTable RMHistDistTable;

                           /* This points to the form table buffer */

                           RMHistDistTable = Dynamics.Tables.RmDistributionHistory;

                           RMHistDistTable.Key = 1;

                           RMHistDistTable.Clear();

                           RMHistDistTable.RangeClear();

                           RMHistDistTable.DocumentNumber.Value = VoucherNumber;

                           RMHistDistTable.RangeStart();

                           RMHistDistTable.Fill();

                           RMHistDistTable.DocumentNumber.Value = VoucherNumber;

                           RMHistDistTable.RangeEnd();

                           err = RMHistDistTable.GetFirst();

                           while (err != TableError.EndOfTable)

                           {

                               Do stuff..

                           }

  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Get data tables names associated with a grid?
    [quote user="Richard E Wheeler"]

    So it does not change depending on whether you are zooming back to an open document or an historical document?

    [/quote]

    Attached table don't get changed but with the dexterity code we can make grid /scrolling window fill with other table instead of the linked table.

    SO  you have to add more lines of code to switch b/w the tables for open and historical documents.

  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,915 Most Valuable Professional on at
    RE: Get data tables names associated with a grid?

    Hi Richard

    Technically, this is a Dexterity Scrolling window which is represented as a Grid in VBA and .Net, but does not behave much like an actual Grid.

    You can use Dexterity (or the GP Power Tools Resource Information window) to get a list of the tables associated with a form.

    I would suggest using the Dexterity Script Profile to identify the tables associated with a scrolling window. This table should show as multiple read events in the Script Profile as the data is displayed in the scrolling window.

    To capture the log, there are a heap of manual steps, but just using GP Power Tools Manual Logging is the simplest method. Just start before the window is opened and stop after the window has opened and the scrolling window has been filled.

    Remember that it is possible in code to change the table used and sometimes temporary tables are used. For example: Work/Open/History tables, or a temp table combining all three.

    Hope this helps

    Regards

    David

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Get data tables names associated with a grid?

    So it does not change depending on whether you are zooming back to an open document or an historical document?

  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Get data tables names associated with a grid?

    If you want to know the table attached with the zoom scrolling window, then it is actually RM_Distribution_Work table and in VS it's RmDistributionWork.

    If you are talking about this window.

    distWindow.png

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Get data tables names associated with a grid?

    I am trying to confirm the RMDistributionHistTable and not RMDistributionWorkTable off the RM Inquiry screen when zooming on an open or historical document. What brought this up is a loop I have on the grid. I have loops on many other grids but for this one, for some peculiar reason, when I loop the sequence numbers go 16384,32768,16384,32768 on and on forever and it never exits. You will see my code in a previous post.

  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Get data tables names associated with a grid?

    I don't think there is a programmer reference for that.

    In VSTools tables and forms name appear little different but can be guess with their name.

    Which table you want to confirm the name in VSTools?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans