Where Macro Clause Business Rules Scripting

I have been working with the ECMA scripts and need to be able to filter data with a where clause like…

SELECT MSTR.TOOLBOX_ID
FROM TOOLBOX MSTR
WHERE UPPER(MSTR.TOOLBOX_NAME) LIKE ‘%TOO’;

I am doing something similar in my Delphi application using…

  pi_DAWhereClause.Expression := pi_DAWhereClause.NewBinaryExpression(
                                  pi_DAWhereClause.Expression
                                , pi_DAWhereClause.NewBinaryExpression(
                                    pi_DAWhereClause.NewMacro('UPPER(MSTR.COMPANY_NAME)')
                                  , pi_DAWhereClause.NewConstant(PrepParamForLike(editName.Text), datString)
                                  , dboLike)
                                , dboAnd);

but when I bring this same concept into ecma script I have issues with the NewMacro statement…

    whereClause = WhereBuilder.createBinary(
                              whereClause
                            , WhereBuilder.createBinary(
                                 WhereBuilder.createMacro('UPPER(MSTR.TOOLBOX_NAME)')
                                ,WhereBuilder.createConstant(prepParamForLike(editName.Text),'datString') 
                                ,'dboLike')
                            , 'dboAnd');

When I look at the code the createMacro takes one additional arguement but I don’t know what it is…

I haven’t done much with macros in the past so maybe I’m just missing something.

Thanks,
Nathan

Hi,
from WhereBuilder Object :

createMacro(name, args…)

Creates a WhereMacro Object. See the Macro Processor for more information on macros and when to use them.

you should specify empty array or null value for 2nd argument