Skip to content

Commit

Permalink
ATR-634: added example from github issue #409
Browse files Browse the repository at this point in the history
  • Loading branch information
SENya1990 committed Nov 2, 2021
1 parent 0aa7c19 commit 6115017
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using PX.Data;
using PX.Objects.AP;

namespace PX.Objects.HackathonDemo.BqlParamsMismatch
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class APInvoiceEntryExt : PXGraphExtension<APInvoiceEntry>
{
protected virtual void __(Events.RowSelecting<APInvoice> e)
{
if (e.Row != null)
{
PXSelectBase<APTran> cmd =
new PXSelectReadonly<APTran,
Where<APTran.tranType, Equal<Required<APTran.tranType>>,
And<APTran.refNbr, Equal<Required<APTran.refNbr>>,
//Accidentally left this And here when WhereAnd was written.
And<APTran.lineNbr, Equal<Required<APTran.lineNbr>>>>>>(Base);


if (cmd is PXSelectReadonly<APTran,
Where<APTran.tranType, Equal<Required<APTran.tranType>>,
And<APTran.refNbr, Equal<Required<APTran.refNbr>>,
//Accidentally left this And here when WhereAnd was written.
And<APTran.lineNbr, Equal<Required<APTran.lineNbr>>>>>> s)
{

}



using (new PXConnectionScope())
{
bool b = false;

//Warning doesn't show in either case.
if (b)
{
cmd.WhereAnd<Where<APTran.lineNbr, Equal<Required<APTran.lineNbr>>>>();

cmd.Select(e.Row, e.Row.DocType);
}
else if (false)
cmd.Select(e.Row.DocType, e.Row.RefNbr);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<Compile Include="Extensions\NonPublic and without IsActive\SOOrderEntryExt.cs" />
<Compile Include="Extensions\NonPublic and without IsActive\SOOrderExt.cs" />
<Compile Include="Graph\BQL Parameters Count Mismatch Test\SOOrderByTypeAndStatusSelect.cs" />
<Compile Include="Graph\BQL Parameters Count Mismatch Test\APInvoiceEntryExt.cs" />
<Compile Include="Graph\BQL Parameters Count Mismatch Test\SOOrdersInq.cs" />
<Compile Include="Constants.cs" />
<Compile Include="DAC\Constructors In DAC\POLineExt.cs" />
Expand Down

0 comments on commit 6115017

Please sign in to comment.