Form update on a 2 tables business view

jplessis

Member
I have a business view built on 2 tables correctly joined.
This business view is used in a headerless detail form. The insert is working but update is failing.

After debugging the issue, I noticed the following things :

- during insertion, I see 2 insert statements, one on table A and one on table B. On screen values are used and everything goes fine.

- during update, I see 2 statements too. But the A table update is correct while the B table update is wrong. It uses the new value in the where clause of the statement. For example, if my GC X has been set to 5 by the user, the update will be like "UPDATE B SET X = 5 WHERE X = 5;". I can't find a way to tell JDE to use the old GC value in the where clause.

As a beginner on JDE, I feel really stuck on this problem. Any idea or advice would be greatly appreciated. Thanks to all JDE gurus.
 
It looks like you are allowing the user to update the primary/unique key of the table? That can be tricky. You can store the old GC value in a hidden field and do the update manually using table i/o in ER code.
 
Thanks for your reply, you're right, the user is updating a primary key field.
To be more precise, table A is F41061 and table B is a specific table created to store comments linked to F41061 data.
We decided to use the same key in table B as in table F41061, and the updated field X is indeed part of the key.
I'm going to try to use hidden values and do the update myself in E/R code. But there's still one thing I can't understand. Why is the form doing the right update for table A (F41061) and not for my new table B ?
 
I fixed my issue by adding a distinct PK to my B table, so that the user can update the other fields witout touching the PK.
Thanks a lot for your advice.
Regards.
 
I would use two views, each looking into a single table.
Use the header view for the header section and the detail view for the the other one.
 
Back
Top