Announcements
Hi
I have some parameterization table (table X) which have personnel number and its custom properties. This table is a data source for a simple form with two command buttons (NewButton, DeleteButton).
Now, I have to add to that form a column with department (from OMOperatingUnit.Name). I have added few new data sources to get information about department (HcmWorker -> HcmPositionWorkerAssignment -> HcmPosition -> HcmPositionDetail -> OMOperatingUnit; LinkType - OuterJoin).
The problem is: when I'm trying to add a new record to my parm table (table X) I have validation error with info, that some field in OMOperatingUnit is empty. When I change LinkType to Delayed or Passive I can add new record without problem but in form grid data in department column isn't visible (sometimes active or first record only)
How to set it up?
If the topic of this thread (Form with multi-datasources inserting new record into one table only) is resolved, please verify the answer. And either create a new thread for the other topic, or I (as a moderator) can split this thread for you.
Thank you - it works fine (previously I have tryied override write() and initValue() method instead validateWrite())
Another, but coresponding problem is:
The table X (next one - I have few such parm forms) has ValidTimeStateFieldType set as Date. The form's datasource (table x) has ValidTimeStateAutoQuery set to DateRange. Unfortunatelly connecting table x datasource to HcmPositionWorkerAssigment (through HcmWorker) I'm getting error with incomatible data type in ValidTimeStateFieldType between those two tables. The form woks only if ValidTimeStateAutoQuery on table X datasource is set to AsOfDate, what is undesirable.
Is the any way to achieve it without changing ValidTimeStateAutoQuery to AsOfDate?
You'll need some code to achieve that; fortunately it's very simple. You'll need to override two methods of the joined data source(s).
Remove super() from write() to prevent saving of the record. And skip super() in validateWrite() as well (and return true) to skip all the irrelevant validations.
André Arnaud de Cal...
294,060
Super User 2025 Season 1
Martin Dráb
232,858
Most Valuable Professional
nmaenpaa
101,158
Moderator