8/14/2025 5:26:28 AM
|
|
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!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
Associating 2-grids as a 1:N
Posted: 21 Oct 08 11:54 AM
|
HiYa Gurus,
I am looking for some best practices on how to do this…
I have a tab view that has 2-grids on it. The first grid is SalesOrders and the second grid is the SalesOrdersDetails. When a record is selected in the first grid, I want it to show the associated line items in the second grid. This would obviously be a simple answer in the Lan Client, but am struggling with how to do this in the web.
I am pretty sure that I need to create a business rule to do this but not sure what I need to do. Do I just assign the business rule to the [GetByMethod] of the second data source? Will that automatically refresh as items are selected from the first grid?
Does anyone have a code snippet or advice they could share that would get me in the right direction?
--Ken--
|
|
|
|
Re: Associating 2-grids as a 1:N
Posted: 22 Oct 08 3:33 AM
|
Hi Ken,
I must confess I havent had to do this yet, but I would have though the way you have mentioned wouldnt work - I dont think it would be clever enough to automatically refresh the second grid without you telling it what to do.
Personally, I would create a quickform with the two grids on, with all their columns etc already set up (to save manually writing the code for them). Add the select button so SLX will even write the event handling code for you. Then reimport it after deploying and make it a custom smartpart so you can edit the methods properly. Then inside the event handling code for the select click on the first grid, you can call and update your datasource for grid two, and call a databind for your second grid. This will refresh it. Depending on how your business rule is set up you may have to pass in the selected entity in grid one into the business rule for grid 2. You will have the ID of the selected record, just use the EntityFactory to create an instance of the entity you require and pass it in.
Just make sure your business rule returns the necessary values for grid 2.
When I had to do something similar I used SQLDataSource (using good ol' plain SQL) - a bit simpler if you are coming from the LAN world, as opposed to a business rule, but I would encourage getting used to using business rules to return lists as this is just the way it should be in the new web 
Cheers, Nick |
|
|
| |
| |
|
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!
|
|
|
|
|
|
|
|