And NEVER use the BINDID or grid linking property :BINDID in a SalesLogix Grid. That means NEVER. Walter, shame on you for suggesting this as a veteran LAN developer.
As stated elsewhere each one of the following is a total round trip to the server SQL Query with additional time taken to provide Row Level Team security and Field Level Security to each field to any and all user's regardless of how simple the query is and whether or not Row Level or Field Level Security is even necessary.
Always run the SLXPRofiler to see how many times and when your query to fill up the datagrid is being run.
The following properties\functions will fire off a complete refresh of the database grid, only 1 is necessary EVER.
1. The Grid's BINDID property is databound
2. Linking property IN the data grid SQL query builder (e.g. A1.OpportunityID = :BINDID)
(yes, this means that your normal OOTB SLX Datagrid Tab form fires off TWICE, remember once only is ever necessary).
3. Grid.SQL.TEXT = MyComplexSQLViewContainingStatement
4. Set Grid.RecordSet = MyADORSwithTheSQLViewInTheRecordSet.
5. Grid.Connection = (not usually done, but it will refresh the database grid).
6. Grid.Refresh
7. ShowViewForRecord (this automagically fires of an AXFormChange for the tab, that probably triggers a refresh of the grid...which means ShowViewForRecord followed by Grid.Refresh is 2-6 refreshes.)
If I had a dollar for every time an experienced SLX Developer used more than ONE of these 7 methods to refresh a datagrid I'd be a rich man indeed....
Just found out that the LAN Account\Contact\LEad NOTES Memo tabs are being refreshed TWICE for example....once on the AXFormOpen, once on the AXFormChange.
The Opp Contact stuff does a
grdOppContact.RecordSet = objOppContactRS
grdOppContact.Refresh
(this has been around for about 10 years, I can't believe that a Sage Developer would actually submit this to production!).
|