Hello community,
I have a table that has a unique restraint that includes a number of columns.
What I now need to achieve is: Instead of throwing an error when the user tries to save a duplicate new record I want iDempiere to load the existing record with the same properties and use that instead of the one that could not be saved.
That would mean:
- in a tabbed window: load the existing record into the tab (or switch to the record item if already in the list
- in a quick editor: enter the ID of the existing record into the GridField from where the QuickEditor was launched.
I am a bit a loss now because AFAIK the before new event handler does not know anything of the gui while the gui aware callout mechanism can not be used to modify the onsave behaviour. Also to achieve a consistent behavior there should be an analog mechanism when the save is invoked by a process instead of a user interaction.
I am aware that I haven't thought that perfectly through but maybe somebody has already solved that riddle?
As always thanks for any helpful hints and comments.
Andreas