Current version: SmartClient Version: v11.1p_2018-07-19/PowerEdition Deployment (built 2018-07-19)
The client is executing an addData( record, new DSCallback () {}, DSRequest ); using an Operation ID in the DSRequest to vector to this operation binding 'cloneWaiverRuns'
I need to ADD a clause to the final WHERE of the form:
AND (WR.WBLOCK LIKE 'foo\_far' OR WR.WBLOCK LIKE '%pcie%' OR WR.WBLOCK LIKE 'Another%Example')
Note there are SQL LIKE widecards in the clause.
I have tried setting an AdvancedCriteria on the DSRequest of the addData() but this causes the data of the passed record to be dropped. Something comes to my memory of adding a Criteria to an addData() call changes it into the fetchData() call ?
In that case I modified the last line of the operation to:
WHERE Target.PNR_WaiverRunState is NULL AND $defaultWhereClause
hoping the passed Adv. Criteria would be added but no success.
Anyway I have tried adding the complex Where clause as a String type to the record, as an attribute called blockCrit, and accessing it's value by:
WHERE Target.PNR_WaiverRunState is NULL AND $rawValue.blockCrit
but that failed.
So is this doable? Is there a way to use velocity in the Operation binding to add the complex criteria - which is a long list of OR clauses, and I don't know how long the clause may be ahead of time. The user selects from a large list to sub-select the WBlock values.
Can you point me in the right direction?
The client is executing an addData( record, new DSCallback () {}, DSRequest ); using an Operation ID in the DSRequest to vector to this operation binding 'cloneWaiverRuns'
Code:
<operationBinding operationType="add" operationId="cloneWaiverRuns">
<customSQL>
INSERT INTO PNR_Waiver_Run(
Waiver_Comment
,WMode
,WSubMode
,WModeType
,WStageName
,WVoltage
,WCorner
,WTemp
,WBlock
,WProjName
,WRevision
,PNR_WaiverRunState
,FK_BCG_UIWaiverMaster
)
SELECT
WR.Waiver_Comment
,WR.WMode
,WR.WSubMode
,WR.WModeType
,WR.WStageName
,WR.WVoltage
,WR.WCorner
,WR.WTemp
,WR.WBlock
,$values.tgtProjName
,$values.tgtRevision
,'Pending'
,PK_TGT
FROM PNR_Waiver_Run as WR
JOIN dbo.BCG_WaiverMaster as WM_Src ON (WM_Src.PK_BCG_Waiver_Master = WR.FK_BCG_UIWaiverMaster AND WM_Src.FK_idProject = $values.pkSrcProj)
JOIN ( SELECT WM2_Tgt.PK_BCG_Waiver_Master as PK_TGT, * FROM BCG_WaiverMaster as WM2_Tgt
LEFT JOIN PNR_Waiver_Run as WR_Tgt ON (WM2_Tgt.PK_BCG_Waiver_Master = WR_Tgt.FK_BCG_UIWaiverMaster)
WHERE WM2_Tgt.FK_idProject = $values.pkTgtProj )
AS Target ON (Target.FK_WaiverRequestor = WM_Src.FK_WaiverRequestor
AND Target.Waiver_Table = WM_Src.Waiver_Table
AND Target.NameOfWaiverSet = WM_Src.NameOfWaiverSet
AND Target.Public_Set = WM_Src.Public_Set)
WHERE Target.PNR_WaiverRunState is NULL
</operationBinding>
AND (WR.WBLOCK LIKE 'foo\_far' OR WR.WBLOCK LIKE '%pcie%' OR WR.WBLOCK LIKE 'Another%Example')
Note there are SQL LIKE widecards in the clause.
I have tried setting an AdvancedCriteria on the DSRequest of the addData() but this causes the data of the passed record to be dropped. Something comes to my memory of adding a Criteria to an addData() call changes it into the fetchData() call ?
In that case I modified the last line of the operation to:
WHERE Target.PNR_WaiverRunState is NULL AND $defaultWhereClause
hoping the passed Adv. Criteria would be added but no success.
Anyway I have tried adding the complex Where clause as a String type to the record, as an attribute called blockCrit, and accessing it's value by:
WHERE Target.PNR_WaiverRunState is NULL AND $rawValue.blockCrit
but that failed.
So is this doable? Is there a way to use velocity in the Operation binding to add the complex criteria - which is a long list of OR clauses, and I don't know how long the clause may be ahead of time. The user selects from a large list to sub-select the WBlock values.
Can you point me in the right direction?
Comment