11/22/2024 4:55:11 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 usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
Datagrid - error updating joined table
Posted: 21 Jan 10 3:35 PM
|
I am getting the error "Row cannot be located for updating. Some values may have been changed since it was last read" when using the datagrid to update data in a table that is joined to the grid's base table one to one relationship. If I update field in the base table, no error occurs.
More detail: Using SLX 7.2.2.1871 I dropped a datagrid onto the Close Opportunity form. Set the BindId to OpportunityId. Clicked on the SQL button, then set the table to the Opportunity Product table, set the join table to the Opportunity Product table and then dragged some fields into the layout section. The fields added to the layout section include fields from tables Opportunity_Product, Product and C_Opportunity_Product (custom table with a 1:1 relationship to the Opportunity_Product table).
The resulting SQL field is: (SELECT A1.OPPPRODUCTID, A2.ENGAGED A2_ENGAGED, A3.DESCRIPTION A3_DESCRIPTION, A2.ACTUALPRICE A2_ACTUALPRICE, A1.CALCPRICE, A2.OPPPRODUCTID A2_OPPPRODUCTID FROM OPPORTUNITY_PRODUCT A1 INNER JOIN PRODUCT A3 ON (A1.PRODUCTID=A3.PRODUCTID) LEFT OUTER JOIN C_OPPORTUNITY_PRODUCT A2 ON (A1.OPPPRODUCTID=A2.OPPPRODUCTID) WHERE A1.OPPORTUNITYID = :BindID )
When the form is displayed, if I modify a field such as the Calcprice field from the Opportunity_Product table, there are no errors and the updated value is persisted to the database. If I modify a field in my custom table such as Engaged or ActualPrice fields, I get the error messge mentioned above when focus leaves the modified grid field.
Anyone have any ideas on how to fix this short of turning off the PostChanges property and manually (programatically) handling the updates? If I do need to resort to manual handling, is the OnChangeNode event the best place for this code?
thanks for any/all help! Ken
|
|
|
|
Re: Datagrid - error updating joined table
Posted: 22 Jan 10 4:11 AM
|
Hi Ken,
Is there a corresponding record in your custom table? If not there will need to be one generated before including in the grid. Change the join to the custom table to be an inner join to see if your records are still there.
James |
|
|
|
Re: Datagrid - error updating joined table
Posted: 22 Jan 10 3:28 PM
|
Thank you James, that was the problem! I added code to make sure the corresponding records exist in the custom table and the problem is solved. |
|
|
|
Re: Datagrid - error updating joined table
Posted: 20 Feb 10 8:24 AM
|
FYI, if you are going to allow inline edits...make all of your joins INNER JOINS, and have the records respective unique rowID's present in the SQL/Grid (although you can make them invisible).....just a hint from hours of trouble shooting..... |
|
|
|
Re: Datagrid - error updating joined table
Posted: 09 Oct 12 11:11 AM
|
fiogf49gjkf0d I came across this thread when I ran into the same error message. I just wanted to point out that you will see this error message if you dymically update the column that triggered the ItemEdited event.
You can use the FieldName parameter in the ItemEdited function to determine which field should be left alone.
|
|
|
|
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!
|
|
|
|
|
|
|
|