Condition Expression

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Condition Expression

Jeremy Olmstead
Is it possible to use a condition-expr in mini-lang to compare two fields
in a table?  For example let's say I want a list of all fixed assets where
the purchaseCost is greater than the depreciation.  I want to do something
like this:

<entity-condition list="fixedAssets" entity-name="FixedAsset">
    <condition-expr field-name="purchaseCost" operator="greater"
from-field="depreciation"/>
</entity-condition>

But, from-field="depreciation" would then look for an environment variable
named depreciation, which is not what I want.  I want the depreciation
value from the FixedAsset table. Is this possible?

Thanks,
Jeremy Olmstead
Reply | Threaded
Open this post in threaded view
|

Re: Condition Expression

Nicolas Malin-2
Le 03/12/2014 23:32, Jeremy Olmstead a écrit :

> Is it possible to use a condition-expr in mini-lang to compare two fields
> in a table?  For example let's say I want a list of all fixed assets where
> the purchaseCost is greater than the depreciation.  I want to do something
> like this:
>
> <entity-condition list="fixedAssets" entity-name="FixedAsset">
>      <condition-expr field-name="purchaseCost" operator="greater"
> from-field="depreciation"/>
> </entity-condition>
>
> But, from-field="depreciation" would then look for an environment variable
> named depreciation, which is not what I want.  I want the depreciation
> value from the FixedAsset table. Is this possible?
>
> Thanks,
> Jeremy Olmstead
>
The better way seems to create a dedicate view entity to resolve your
condition by the database.
Nicolas