I am having problems writing an expression rule that uses displayvalue() functio

I am having problems writing an expression rule that uses displayvalue() function.

I have an array CDT called BusinessRulesCDT. It keeps erroring out complaining about the 4th argument to displayvalue() which is the default value.

At run time, it gives the error message:

Details: ERROR:An error occurred while evaluating expression: businessRule:rule!findBusinessRuleCDT(pv!businessRuleArray, pv!ruleName,pv!defaultBusinessRule) (Expression evaluation error in rule 'findbusinessrulecdt' at function 'displayvalue' parameter 4: ) (Data Outputs)

My BusinessRuleCDT is:
- id (integer)
- name (text)
- value (text)

my expression rule is:

findBusinessRuleCDT(businessRuleArray (Any Type), ruleName (Text), defaultBusinessRule (Any Type))
which calls ==> displayvalue(ri!ruleName, ri!businessRuleArray.name, ri!businessRuleArray, ri!defaultBusinessRule)

For the 4th parameter, I tried {}, "", and even the example above where I pass ...

OriginalPostID-170427

OriginalPostID-170427

  Discussion posts and replies are publicly visible

Parents
  • @briank I would like to say that your expression body exactly doesn't already look like that. So the definition of findBusinessRuleCDT rule which you have created is as follows:

    fn!displayvalue(ri!ruleName,ri!businessRuleArray.busrules_name,ri!businessRuleArray,ri!defaultBusinessRule)
    Here if you see the second argument of displayvalue(), you are using an inexistent field, namely 'busrules_name' in cdt. Even the logs are suggesting the same.

    The suggestion which I have made is as follows after correction of busrules_name to busrule_name in second argument of displayvalue() in findBusinessRuleCDT rule:
    fn!displayvalue(ri!ruleName,ri!businessRuleArray.busrule_name,ri!businessRuleArray,ri!defaultBusinessRule)

    I would like to suggest to proceed with conclusions after the correction of error in current implementation.
Reply
  • @briank I would like to say that your expression body exactly doesn't already look like that. So the definition of findBusinessRuleCDT rule which you have created is as follows:

    fn!displayvalue(ri!ruleName,ri!businessRuleArray.busrules_name,ri!businessRuleArray,ri!defaultBusinessRule)
    Here if you see the second argument of displayvalue(), you are using an inexistent field, namely 'busrules_name' in cdt. Even the logs are suggesting the same.

    The suggestion which I have made is as follows after correction of busrules_name to busrule_name in second argument of displayvalue() in findBusinessRuleCDT rule:
    fn!displayvalue(ri!ruleName,ri!businessRuleArray.busrule_name,ri!businessRuleArray,ri!defaultBusinessRule)

    I would like to suggest to proceed with conclusions after the correction of error in current implementation.
Children
No Data