It seems that when I have a single criteria the $criteria substitution variable works but when I have multiple criteria via use of AdvancedCriteria it does not. In the first instance I am issuing the following DSRequest.
The custom SQL in my ds.xml looks, in part, like this.
The resulting SELECT statement looks like this. So far so good.
In the second scenario my DSRequest looks like this.
My custom SQL looks almost identical to the first.
But the resulting SELECT looks like this.
Why isn't $rawValue.criteria.FileGroupSuffix being replaced by the FileGroupSuffix criteria? Is there an alternative syntax I need to use with Advanced criteria?
Code:
=== 2010-04-14 19:00:36,881 [l0-2] DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ FileGroupSuffix:"_F002" }, operationConfig:{ dataSource:"PoHeader", operationType:"fetch", textMatchStyle:"exact" }, startRow:0, endRow:75, componentId:"isc_OID_222", appID:"builtinApplication", operation:"PoHeader_fetch", oldValues:{ FileGroupSuffix:"_F002" } }
Code:
FROM ippohdr#if($rawValue.criteria.FileGroupSuffix)$rawValue.criteria.FileGroupSuffix#end join POItem on HONO=IONO where $defaultWhereClause
Code:
FROM ippohdr_F002 join POItem on HONO=IONO where ('1'='1')
Code:
=== 2010-04-14 19:01:38,841 [l0-3] DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ _constructor:"AdvancedCriteria", operator:"and", criteria:[ { _constructor:"AdvancedCriteria", fieldName:"IONO", operator:"equals", value:"0HOMETEX03" }, { _constructor:"AdvancedCriteria", fieldName:"FileGroupSuffix", operator:"equals", value:"_F002" } ] }, operationConfig:{ dataSource:"PoItem", operationType:"fetch", textMatchStyle:"exact" }, startRow:0, endRow:75, componentId:"isc_OID_225", appID:"builtinApplication", operation:"PoItem_fetch", oldValues:{ _constructor:"AdvancedCriteria", operator:"and", criteria:[ { _constructor:"AdvancedCriteria", fieldName:"IONO", operator:"equals", value:"0HOMETEX03" }, { _constructor:"AdvancedCriteria", fieldName:"FileGroupSuffix", operator:"equals", value:"_F002" } ] } }
Code:
from ippoitm#if($rawValue.criteria.FileGroupSuffix)$rawValue.criteria.FileGroupSuffix#end WHERE $defaultWhereClause
Code:
from ippoitm WHERE ((IONO = '0HOMETEX03' AND IONO IS NOT NULL))
Comment