The following can be a valuable piece of information to you in case you are handling code for grids.
We shall use the example of the ‘Bin Transfer’ task.
Suppose you have to work with the total number of rows that are loaded in the grid when a warehouse – item combination is chosen in the lookups. You would use the DataRowCnt property of the grid control or the glGridGetDataRowCnt function to get the no. of rows in the grid. But the value returned will not be the total no. of rows in the grid but only those rows which are currently visible in the grid. If the user scrolls down and then checks the DataRowCnt property the value returned will be higher. Of course, this would be noticed only if there are at least more than 10 rows for the warehouse – item combination.
Consider our following example:
We have purchased 27 quantities of an item named ‘TestItem’ distributing 1 quantity each in a different bin. So there is 1 quantity of TestItem in 27 different bins.
Next we open the Bin Transfer task and add the warehouse – item combination. The grid loads with the details for each bin. We have added a button named ‘Get Data Row Count’ on the form. We have written code in the click event of the button to get the DataRowCnt property of the grid control and display the value in a message box.
If you would check the DataRowCnt now you will get a value of 10 when there are actually 27 rows in the grid.
Now if you scroll down to the end of the grid and then check the DataRowCnt you would get the correct value of 27.
So, in order to get the correct no. of rows, the user will have to scroll down to the last row in the grid. But if you need to find the total no. of rows without having any user interaction you can’t use the DataRowCnt property. This is where the PartialLoad property can help. The PartialLoad property of the Grid Data Manager object is responsible for populating the rows in the grid. If this property is set to ‘True’ the rows are not loaded unless the user scrolls down in the grid. If this property if set to ‘False’ all rows are loaded and no user interaction is needed.
So, you need to change the source code and set the PartialLoad property of the Grid Data Manager object to ‘False’. Now you can get the correct total no. of rows as soon as the grid is loaded without requiring the user to scroll down.
This information can be helpful to you in case you come across such a situation while working with grids on any MAS 500 screen.
For any further assistance, feel free to contact us at sage@greytrix.com.
About Us
Greytrix is a one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.
Greytrix has some unique solutions of Sage 100 integration with Sage CRM, and Salesforce.com along with Sage 100 Migration from Sage 50 US, Sage Intacct, QuickBooks, Sage Business Vision and Sage Business Works. We also offer best-in-class Sage 100 customization and development services to Sage business partners, end users, and Sage PSG worldwide.
For more details on Sage 100 Services, please contact us at sage@greytrix.com. We will be glad to assist you.