0
votes

I have two database blocks: A and B. I also have 3 tabs:

  • first tab has items from block A,
  • second one has items from block B,
  • third one has items from block A

All fields from both blocks are required.

My problem is that I want to enter fields in the order of tabs, but in my case because of required fields when I want to go to the second tab, it takes me to the third to enter all fields, and then the second one.

How to solve this?

1

1 Answers

0
votes

When you navigate from the first tab (based on table/block A) to the second tab (based on table/block B), Forms perform validation and - as not all required fields that belong to table A (the ones that are placed to the third tab) aren't populated - Forms raises an error.

One option would be to remove the "Required" property from all fields that belong to table A and are placed to the third tab. It means that you'd have to check whether they are populated manually, i.e. write a trigger which would do that. Which one? PRE-INSERT and PRE-UPDATE might be your choices. Code would look like

if :tab3.field1 is null or
   :tab3.field2 is null or ...
then
   message('Not all fields have been populated on tab 3');
   raise form_trigger_failure;
end if;

Or, rearrange the layout by

  • moving fields from tab 3 to tab 1, or
  • switching tab 2 and tab 3 positions

Or, if the process goes like that, maybe your data model is wrongly set. What you described looks like some kind of a "master-detail" relationship, where table A acts as "master" and table B as "detail". You shouldn't populate master partially, especially not if all its columns are required. If that's the problem, well, then it really is a problem as changing data model doesn't necessarily be simple as it affects quite a lot of things.