How to use Const in FBQL for Acumaitca

Hello everybody,

I want to leave a quick hint on how to use Const values in Acumatica for FBQL. Below goes sample:

public class someBranch : PX.Data.BQL.BqlInt.Constant<someBranch>
{
    public someBranch() : base(48)
    {
    }
}

Then later on you can use it in your BQL and FBQL queries for filtering

How to use FBQL in PXProjection

Hello everybody,

Recnetly I had a need to create PXProjection and wanted to use in declaration of it not SelectJoin, but FBQL SelectFrom with combination of InnerJoin. Finally I've got something like this:

[PXProjection(typeof(SelectFrom<SOOrder>.InnerJoin<SOLine>.On<SOOrder.orderType.
    IsEqual<SOLine.orderType>.And<SOOrder.orderNbr.IsEqual<SOLine.orderNbr>>>))]
public class SalesOrderLines
{
}

Nothing fancy, but during initial coding error messages were a bit confusing

FBQL brackets

Hello everybody,

today I want to speak about one very interesting feature of FBQL, which I don't know if exists in BQL. Function Brackets!

Take a look on following code sample:

var bracketsDemo = SelectFrom<SOOrder>.InnerJoin<SOLine>.On<SOLine.orderNbr.IsEqual<SOOrder.orderNbr>>.InnerJoin<SOShipLine>
	.On<SOShipLine.origOrderNbr.IsEqual<SOOrder.orderNbr>>.Where<
		Brackets<SOShipLine.confirmed.IsNotNull.
			And<SOShipLine.baseOrigOrderQty.IsNotNull>.
			And<SOShipLine.completeQtyMin.IsNotNull>.
			And<SOShipLine.confirmed.IsEqual<True>.
				Or<SOShipLine.confirmed.IsNull>>.
			And<SOShipLine.baseOriginalShippedQty.IsGreater<SOShipLine.unassignedQty>.
				Or<SOShipLine.baseOrigOrderQty.IsLess<SOShipLine.baseOriginalShippedQty>>>>.
		Or<SOShipLine.baseOrigOrderQty.IsNotNull>>.AggregateTo<GroupBy<SOOrder.orderNbr>,
		Min<SOOrder.curyDiscTot>>.OrderBy<SOOrder.curyFreightAmt.AscSOOrder.curyDocDisc.Desc>.View.Select(Base);

as you can see from the code, now in FBQL if you need to have Or operator, then as anohter option you may use Brackets.

Required of BQL in FBQL of Acumatica

Hello everybody,

today I want to describe how analogue to Required works in Acumatica Framework.

For example, in the past ( before 2019 R1 ) you may read something from Acumatica with help of Required:

var contact = PXSelect<ContactWhere<Contact.displayNameIsNotNullAnd<Contact.displayName
Contains<Required<Contact.displayName>>>>>.SelectWindowed(graph, startIdx, 1, ' ').First();

Now, you can use @P.AsString, as shown on code sample below:

var contact = SelectFrom<Contact>.Where<Contact.displayName.IsNotNull.And<Contact.displayName.
Contains<@P.AsString>>>.View.SelectWindowed(graph, startIdx, 1, ' ').First();

Conclusion

Also take a note, that FBQL looks a bit simpler then BQL which has plenty of <<<>>>>