Skip to content

Remove validation restriction of data parameter to getAll being only a constant or variable (to enable FunctionExpression) #686

@aormerod-gs

Description

@aormerod-gs

return isDateConstant(coreInstance) || isVariableExpressionReturningADate(coreInstance);

Currently the method checks that the business date is a constant or a VariableExpression, expecting use cases of

MyClass.all(%2015-01-01)

or

let businessDate = today(); 
MyClass.all($businessDate );

However it gives compiler usage like

let businessDate = today(); 
MyClass.all($businessDate )
     ->concatenate(MyClass.all($businessDate->adjust(-1, DurationUnit.DAYS));

due to the parameter being a FunctionExpression.

Although people can still create an equivalent query via:

let businessDate = today(); 
MyClass.all($businessDate )
     ->concatenate({d:Date[1]|MyClass.all($d)}->eval($businessDate->adjust(-1, DurationUnit.DAYS));

and the compiler won't complain (but it's more complicated to write / less clear)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions