Hello Everyone,
We are working with 23 R1 build version 23.106.0055.
We have a scenario where we need to get the Invoice Status and Released flag status when we are releasing the invoice.
On releasing the invoice, the status will change form Balanced to Open. But when we are trying to get the value in Base.Document.Current.Status, we are getting the status as Balanced.
At the same time on Invoice Release action, the Released flag will also set to true but when we are trying to access this value we are getting this as false only.
On creating invoice directly:
- On Save action, under Persist method, we observed that Released flag is false.
- On Invoice release, Persist method triggering 2 times first time Released flag is false and when it triggered second time Released flag is true.
On Creating Invoice through Sales Order:
- On prepare invoice it triggered and release is false.
- On Release invoice it triggered once and release is false.
We also verified with ARInvoice_RowPersisting and ARInvoice_RowPersisted events but the behavior is the same and we are not getting Released flag as true and Status as Open.
Sample code:
public class SOInvoiceEntry_Extension : PXGraphExtension<PX.Objects.SO.SOInvoiceEntry>
{
PXOverride]
public void Persist(Action del)
{
del();
if (Base.Document.Current?.Released == true && Base.Document.Current.Status == "Open")
{
}
}
}
Can you please review and suggested the best possible way to achieve this.
Thank you!