Hello All,
I found that a Where clause in a BusinessProcess prevents OnLeaveRow when it contains a comparison between two columns in the base table.
Here is a example:
class TestProcessReference1 : BusinessProcessBase
{
readonly Models.GlobalProcesses.ProcessReference processReference = new Models.GlobalProcesses.ProcessReference { ReadOnly = true };
TEST_WhereProblem _parent;
public TestProcessReference1(TEST_WhereProblem parent)
{
_parent = parent;
From = processReference;
Where.Add(processReference.PXPZAR.IsEqualTo(processReference.PXVPZA));
}
public void Run()
{
Execute();
}
protected override void OnLeaveRow()
{
System.Diagnostics.Debug.WriteLine($"OnLeaveRow {processReference.PXPZNR}");
}
}
In the debug output I see that the query is ok and returns 1528 records:
(0)-ExecuteNonQuery - sp_cursorprepexec
Query Parameters:
declare @stmt nvarchar(115) = 'Select PXPZAR, PXPZNR, PXPOSI, PXFOLG, PXVPZA, PXVPZN, PXVPOS, PXVPFO, PXMEPZ
From GBPZZU
Where PXPZAR = PXVPZA'
declare @scrollopt int = 1 /*1*/
declare @ccopt int = 98305 /*18001*/
(0)-
Result values:
declare @handle int = 1073741827
declare @cursor int = 180150007
declare @rowcount int = 1528
What am I missing here?
Thanks for any help or advice,
Tilmann Brenk