-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ATR-634: added example from github issue #409
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
...mo/PX.Objects.HackathonDemo/Graph/BQL Parameters Count Mismatch Test/APInvoiceEntryExt.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters