Skip to Content

UDO with child of child

Mar 02 at 05:09 PM


avatar image

I am using a UDO (named Programs) I created by code that has a number of child tables.

One of these child tables (named Benefits) is in fact a child table of another child table (named Classes) of the UDO. There is no problem in displaying and editing the rows of the Classes table as they are linked directly the UDO object. However, I need to display and edit the rows in the table Benefits that are linked to the selected row in the Classes table.

In order to display the Benefits rows related to a certain row of the Classes table, I am using a matrix bound to a datatable which retrieves the data using a query. And to insert/update/delete rows, I am using GeneralService to perform the action and then reload the data in the matrix via datatable.

This works OK, but the problem I have is that after I use General Service to edit the UDO child table, I am no longer able to save the UDO form (using the Update button). I get the error: "Another user or another operation modified data; to continue, open the window again".

This is because the system sees that the current UDO record was updated by another user, when in fact it was edited by the same user but using General Service. So, how can I handle this situation?

I'm currently considering two approaches.

The first one is moving the child of child table(s) to independent UDT tables (No Object Auto-increment). This way I can edit the UDT freely. The problem is that the primary key of the table is not in the form I want, as I need a Code/LineId primary key, where the Code would be the same as the Code of the parent UDO, and the LineId differentiates the row.

The second approach is creating a second UDO (named "Programs Aux") which has a child table (Benefits). This way I can create rows and link them to the child table in the first UDO. Which seems to be a good solution.

Before choosing the second approach, I would like to have input from experts in this community. I am also worried about one issue. This issue being is will I need to do locking of the second UDO, to prevent multiple users from editing the same record using General Service? Is there a problem of having related data across multiple UDO's and will the system handle the issue of multiple edits in this scenario.

Hope my question is clear, and thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Edy Simon Mar 06 at 04:15 AM

Hi Osama,

"Another user or another operation modified data; to continue, open the window again".
Is logically correct, if you update in the background your screen data is already invalid (showing outdated record)

To correct this, you need to refresh your screen after your update the General Service, this way your screen will have uptodate record.
You cannot have half the record updated from UI and half the record updated from General Service, you will need to choose either one.


10 |10000 characters needed characters left characters exceeded