2 Replies Latest reply: Aug 9, 2016 2:37 PM by Matthew Berry RSS

    'If takes 2-3 parameters' issue in script

    Matthew Berry

      I have the following script error when reloading from one line reading "Error in expression: it takes 2-3 parameters."

      q1.PNG

      Here's the scripting:

      q2.PNG

      Here's what ConcatKey =:

      q3.PNG

        • Re: 'If takes 2-3 parameters' issue in script
          m w

          I would be easier to reply if yoour script was text and not a picture.

          You have 2 IFs at the end of the expression. They say something like:

          if(IsNum(ItemID))

          Those IFs have only 1 parameter.

            • Re: 'If takes 2-3 parameters' issue in script
              Matthew Berry

              I don't know how to get rid of them based on the scripting. Any idea?

               

              Load error:

              if(trim('01')='' or IsNull('01'), '*NONE', trim('01')) & '%' & if(trim(If(IsNum(ItemID))='' or IsNull(If(IsNum(ItemID)), '*NONE', trim(If(IsNum(ItemID))) as _ItemID,

               

              Scripting:

              $(ConcatKey('$(varCompanyID)', If(IsNum(ItemID), Num(ItemID,'##########"), ItemID))) as _ItemID,

               

              ConcatKey:

              ConcatKey = if(trim($1)='' or IsNull($1), '*NONE', trim($1)) & '%' & if(trim($2)='' or IsNull($2), '*NONE', trim($2));