3

I have an item that is displayed conditionally - based on another item selection. I want to make that item non-required when hidden. What is the best way to do that?

Coding Duchess
  • 6,445
  • 20
  • 113
  • 209

1 Answers1

6

As you have probably found, you cannot just set the dependent item's Required attribute, as this makes it required even when hidden. Instead you can create a Validation of type "Item is NOT NULL" on the dependent item, but with a server-side condition based on the value of the other item.

For example, suppose the first item is P12_JOB and the second is P12_COMMISSION, and P12_COMMISSION is only shown when P12_JOB = 'SALESMAN'. Then this Validation will do it:

enter image description here

As you can see there are various settings available there that you should check are appropriate for you e.g. Always Execute, Display Location.

Tony Andrews
  • 129,880
  • 21
  • 220
  • 259