I am working a bug and during project creation if the user selects a Large Sto

I am working a bug and during project creation if the user selects a Large Store, Convenience Retail or Drug Value originating channel the selection of project subtype should be an optional (not required) selection. The dropdown selection should not be removed.

Could anyone let me know what could be the logic which I should use so that" Project Subtype"should be optional for Large Store, Convenience Retail or Drug Value originating channel . We are using expression rule "prmOrigChanHasProjectSubType"

=if(contains({cons!PRM_ORIG_CHAN_REGION, cons!PRM_ORIG_CHAN_STORE_LG, cons!PRM_ORIG_CHAN_CONV_RETAIL, cons!PRM_ORIG_CHAN_DRUG_VALUE, cons!PRM_ORIG_CHAN_CANADA, cons!PRM_ORIG_CHAN_OTHER}, ri!origChannel), true(), false())

Also , we have used this expression rule to List of originating channel subtypes for Large Store.

={null(), cons!PRM_ORIG_CHAN_TYPE_REG_CPI, cons!PRM_ORIG_CHAN_TYPE_REG_NONCPI}

Please note the attached screenshot.....

OriginalPostID-119837

OriginalPostID-119837

  Discussion posts and replies are publicly visible

Parents
  • What I am suggesting you do is first test out that ri!origChannel actually gets the value you select from the first dropdown. So make a test field on your form with value:ri!origChannel. Then, take this ri!origChannel and, in the expression editor, plug it into your prmOrigChanHasProjectSubType rule.

    My comments on the other rules were:
    1) prmOrigChanHasProjectSubType: the contains() function returns a boolean already so you don't need the if(). What you're doing with the if() is a superfluous if(true,true,false).

    2) prmListOrigChanSubTypeStoreLG: instead of all of these subsequent if() calls, check out the choose() function
Reply
  • What I am suggesting you do is first test out that ri!origChannel actually gets the value you select from the first dropdown. So make a test field on your form with value:ri!origChannel. Then, take this ri!origChannel and, in the expression editor, plug it into your prmOrigChanHasProjectSubType rule.

    My comments on the other rules were:
    1) prmOrigChanHasProjectSubType: the contains() function returns a boolean already so you don't need the if(). What you're doing with the if() is a superfluous if(true,true,false).

    2) prmListOrigChanSubTypeStoreLG: instead of all of these subsequent if() calls, check out the choose() function
Children
No Data