Home Discussions Questions & Answers Complex Parameter Validation and Defaulting

Complex Parameter Validation and Defaulting

Avatar photoCustomer January 12, 2021 at 11:35 am

I need to enforce complex validation: a user must enter *either* ‘Customer Name’ *or* ‘Account Number’ before running the report, but not necessarily both. How do I define this logical constraint since the simple ‘Required’ flag is insufficient?

Viewing 6 reply threads
  • Author
    Replies
    • Support January 13, 2021 at 7:52 pm  

      You must use the Advanced Required Parameters feature, which accepts a logical expression. For your ‘either-or’ requirement, the expression would be entered as: `:Customer_Name is not null or :Account_Number is not null`. This logic is evaluated at run-time, and if the condition is not met, an error message is displayed.

    • Avatar photoCustomer January 14, 2021 at 11:07 am  

      What are the rules for referencing the parameter names in that logical expression?

    • Support January 14, 2021 at 7:31 pm  

      Parameters are referenced by their names (in the installed base language, usually US), prefixed with a colon (`:`). Any spaces or other non-word characters in the name must be replaced with a single underscore.

    • Avatar photoCustomer January 16, 2021 at 3:27 am  

      If the validation fails, is there a way to display a custom error message instead of the default FND message?

    • Support January 17, 2021 at 12:15 am  

      Yes, you can specify a custom message text directly in the Advanced Required Parameters field. Otherwise, the system defaults to FND message `XXEN_REPORT_INSUFFICIENT_PARAM` or `XXEN_REPORT_ONE_PARAM_REQUIRED` if it detects that at least one parameter entry is required.

    • Avatar photoCustomer January 18, 2021 at 8:35 am  

      I also need Parameter B’s default value to depend on the value selected for Parameter A. What syntax supports defining dependent parameters in the Default Value SQL?

    • Support January 19, 2021 at 2:13 am  

      You define dependencies using the syntax `:$flex$.parameter_or_lov_name`. For example, to inherit the Operating Unit value and add ‘suppliers’, your default value SQL could be: `select :$flex$.operating_unit|| suppliers from dual`. This dependency syntax is used in both LOV queries and default values.

Viewing 6 reply threads
  • You must be logged in to reply to this post.

Login with: