Is there a way to make parameters on an expression rule optional?...

Is there a way to make parameters on an expression rule optional?...

OriginalPostID-35469

OriginalPostID-35469

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer
    Hi moritzw,

    Yes, it is optional to take parameters in expression rule, if you are going to get the data by passing any parameter then it is needful, or else without using the parameters also we directly fetch the whole data from DB.
  • 0
    Certified Lead Developer
    in reply to krishnau3863
    if myRule is a function with parameters: parameter1, parameter 2, and parameter3

    the following code:

    rule!myRule(
    parameter1: local!something
    )

    works just fine. Strangely,

    rule!myRule(
    parameter1: local!something,
    parameterIJustMadeUp: local!somethingElse,
    )

    also happens to work just fine. It ignores what you don't send. It ignores what you do send that it doesn't recognize, and doesn't even give you a warning. If you happen to misspell one of your keywords it can be ages to find the error.

    You do have to send at least one of the parameters by keyword.
Reply
  • 0
    Certified Lead Developer
    in reply to krishnau3863
    if myRule is a function with parameters: parameter1, parameter 2, and parameter3

    the following code:

    rule!myRule(
    parameter1: local!something
    )

    works just fine. Strangely,

    rule!myRule(
    parameter1: local!something,
    parameterIJustMadeUp: local!somethingElse,
    )

    also happens to work just fine. It ignores what you don't send. It ignores what you do send that it doesn't recognize, and doesn't even give you a warning. If you happen to misspell one of your keywords it can be ages to find the error.

    You do have to send at least one of the parameters by keyword.
Children
No Data