Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, February 22, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Populating a data grid
Adam Siegel
Posts: 13
 
Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Nov 13 12:30 PM

I need to create a data grid with calculated data in it for each opportunity I have...I have created the view in SQL that contains the data but I am having trouble linking that view to the grid...I cant seem to move the view in the DB Manager nor can I cahnage any of the settings in the view in the DB manager. This is my fiorst time working with Data grids and I can see a place to enter in SQL code but not seeing how to write the actual query so if anyone has any thoughts I would appreciate the help

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Nov 13 6:21 PM

1. What version of SLX (will tell us how to turn your view into an SLX Table).


2. Take a look at the form System:Insert Opportunity. Plenty of examples there on how to build grid columns, a recordset object, and use SQL to load the recordset into the recordset object of the grid thus refreshing it.....

[Reply][Quote]
Adam Siegel
Posts: 13
 
Re: Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Nov 13 10:24 AM

Using Version 7.53....I did originally create the view in SQL but realized that I propbaly needed to build the table using the SLX DB Manager so I went and deleted it  and recreated it...I will check the forums as you suggested and see if I can resolve, I know I am close to doing the right thing but missing one or two key steps

[Reply][Quote]
Adam Siegel
Posts: 13
 
Re: Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Nov 13 11:09 AM

Yeah, I am definitely missing a step somewhere


I have created the view in SQL and the data is there but I am unable to enable the view in the DB Manager and bind it to Opportunity so I can then populate the data grid....is there a way to enable and then bind the View in SLX if it is created in SQL?

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Nov 13 6:50 PM

No, there's a guide on how to create the Table in SLX, then delete the table in SQL, and create the View of the same name as the table in SQL. That way the Resynchtabledefs (Table Names) and SecTableDefs (Field Names by Table) tables will be correct.....

[Reply][Quote]
Brian Segers
Posts: 69
 
Re: Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Nov 13 9:36 PM

It is  easier than that in your version. As long as sysdba owns the View you should be able to enable it in DB Manager.


It is helpful if the view has somthing you can say is the primary key. Probably whatver you are using to join off of.

[Reply][Quote]
Adam Siegel
Posts: 13
 
Re: Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Nov 13 10:29 AM

Yeah, I can see the view in the DB Manager and it is enabled but I am unable to tie it to the Opprtunity side which is where I need it to be in order to populkate my grid...seems that SLX makes that job a bit more complicated than it needs to be IMO

[Reply][Quote]
Walter Shpuntoff
Posts: 167
 
Re: Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Nov 13 6:29 AM

It's actually not very complicated at all.


1. Your view should be owned by SYSDBA, so the db manager can see it and bring it in.


2. Your view needs to have an OPPORTUNITYID (remember what was stated earlier about the PRIMARYKEY? - that is what he was talking about)


If you have done those two things, then you can Join/Bind/etc your view just like it was a native table.


 

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Populating a data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Nov 13 2:29 PM

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!).


 

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/22/2025 9:16:59 AM