Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 18, 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: Editable Datagrid question
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Editable Datagrid questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Nov 07 11:10 AM
I have an editable grid on a popup screen. Obviously if a user changes some data in the editable grid, then pushes cancel on the popup screen the data edited in the grid is saved anyway. Is there a way to cancel the changes made in editable datagrid when the user clicks cancel on the popup screen? The first thing I come up with is to track any changes made and back them off with SQL if the user presses cancel. This then opens a whole can of worms capturing what is saved as I have had terrible luck with events firing consistantly when data is changed in the grid..

Has anyone come across this or have any suggestions? Thanks
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Editable Datagrid questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Nov 07 12:13 AM
You need to disconnect your datagrid from the underlying data. Then (when user clicks OK/Cancel) update or cancel the changes to the datagrid's recorsdset as required - this is how Opportunity Products works, so suggest you use something similar (but I'll bet you'll end up with something 50 times less complex).

PP
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Editable Datagrid questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Nov 07 9:56 AM
Yes, in these situations, I use disconnected datagrids as well, and I even build those datagrids at runtime. I tried using a connected datagrid and track the changes, but it kept causing problems and unexpected data issues. There is a bit more code involved, but once you have it all set up on your first form, you can reuse the pattern for future work. It's very very nice to work with once it's all set up.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Editable Datagrid questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Nov 07 9:15 AM
Connected Data Grids SLX fires off AUTOMAGICALLY the Update SQL statement for that specific field if there is a change to the oldvalue to the new value..... so no way to cancel it....you have to go with a disconnected grid.....see the Opportunity Product 'stuff' for hints on this (the whole subsystem is disconnected and build from scratch....this takes a LOT of time to code).

The syntax of the Update call in 7.2.x is
UPDATE TABLENAME
SET ChangedFieldName = NewValue
WHERE TablenameID = '" & KeyRowValue & "' AND ChangedFieldName = OldValue

That last AND clause is NEW, it's a gothca, and it helps with Optimistic Locking in a massively concurrent use database.....

If you have other fields that you want to change you must use a SQL statement.....and then you CAN NOT change the Edited Field through that SQL Update statement (because the AUTOMAGIC SQL Update Statement is looking for the OLD VALUE of that field.....and will throw an error if it doesn't find it!!!!!!).

So!
Change Price from $5 to $10 inline Grid Edit
SalesLogix AUTOMAGICALLY issues:
UPDATE OPPORTUNITY_PRODUCT
SET PRICE = 10
WHERE OPPPRODUCTID = '" & KeyRowValue & "' AND PRICE = 5

You need to get the Quantity......and new price in the Edited event for the grid....
Then
Amount = Price * Quantity
UPDATE OPPORTUNITY_PRODUCT
SET Amount = 30
WHERE OPPPRODUCTID = '" & KeyRowValue & "'

Note that I didn't change the Price in my Update statement......

Make Sense?
[Reply][Quote]
Gavin
Posts: 4
 
Re: Editable Datagrid questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Jan 08 12:21 PM
Is there a similar method for 6.2?
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Editable Datagrid questionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jan 08 11:52 AM
There's inline editing in 6.2.6....see the Opp Product stuff...
[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): 8/18/2025 10:59:12 AM