Hi. When the user inserts a line level record in the applications tab of the Invoices form I need to update one of my custom fields. I’m trying to update my custom field which is the UsrTotalCreditDue with a calculation of the values that i get from the two data views. In the code i am also printing the values to the trance. The values get updated in the trance but doesn’t update the field. How can i fix this ?
I meant to take my code, replace public class ARInvoiceEntryExt : PXGraphExtension<ARInvoiceEntry>with public class SOInvoiceEntryExt : PXGraphExtension<SOInvoiceEntry>
Since you want update field you added to the top form, you can use Base.Document.Current to get invoice that is selected in the top form (that’s to replace your logic to get arInvoiceHeader)
You can just compare my event with yours instead of copying everything - again, I tried to keep it similar to yours.
It’s mostly the same as yours. Aside from some formatting changes (which are subjective), the difference is:
The extension is made to the ARInvoice. ARRegister is a parent class for it, but the Acumatica uses reflection to work with all customization extensions, so it might cause issues when Cache is being handled;
Calls to cache changed to use PXCache embedded into the PXView. Direct type calls can be ignored in some cases - Persist checks Caches from Views. If ARRegister and ARInvoice Caches are handled separately, this can cause issues;
You are using 2 options of setting the value at the same time. There’s no point in it. You can use Base.Document.SetValueExt<ARInvoiceExt.usrTotalCreditDue>(arInvoiceHeader, arInvoice.CuryOrigDocAmt - arInvoiceHeader.CuryDetailExtPriceTotal); instead of direct ext.UsrTotalCreditDue = arInvoice.CuryOrigDocAmt - arInvoiceHeader.CuryDetailExtPriceTotal; but they are doing the same.
Also, take a look at your implementation of the UsrTotalCreditDue. Some attributes are able to affect the process. In my example, I decorated the field with the bare minimum of the attributes.
It’s mostly the same as yours. Aside from some formatting changes (which are subjective), the difference is:
The extension is made to the ARInvoice. ARRegister is a parent class for it, but the Acumatica uses reflection to work with all customization extensions, so it might cause issues when Cache is being handled;
Calls to cache changed to use PXCache embedded into the PXView. Direct type calls can be ignored in some cases - Persist checks Caches from Views. If ARRegister and ARInvoice Caches are handled separately, this can cause issues;
You are using 2 options of setting the value at the same time. There’s no point in it. You can use Base.Document.SetValueExt<ARInvoiceExt.usrTotalCreditDue>(arInvoiceHeader, arInvoice.CuryOrigDocAmt - arInvoiceHeader.CuryDetailExtPriceTotal); instead of direct ext.UsrTotalCreditDue = arInvoice.CuryOrigDocAmt - arInvoiceHeader.CuryDetailExtPriceTotal; but they are doing the same.
Also, take a look at your implementation of the UsrTotalCreditDue. Some attributes are able to affect the process. In my example, I decorated the field with the bare minimum of the attributes.
Hello.
This customization is related to Sales Order Invoice. So how can i make the extension to ARInvoice ? Shouldn’t it be made to SOInvoice Entry ?
This is the extension i am using.
Please help. Struggling with this issue since weeks.
I assumed from your first message that you’re trying to customize ARInvoiceEntry. If you need to override SOOrderEntry, you can change the base graph type in the PXGraphExtension<ARInvoiceEntry> part (renaming the graph extension to fit would be nice as well).
However, I’m confused with the part where you’re saying
in the applications tab of the Invoices form
That doesn’t sound like you’re trying to customize Sales Orders screen. You can double-check the graph you need to customize using Inspect Element.
What do you mean by change the base graph in PXGraphExtension<ARInvoiceEntry> part ? In my code should i change PXGraphExtension<PX.Objects.SO.SOInvoiceEntry> to PXGraphExtension<ARInvoiceEntry> ? Can you explain it a bit more?
Also, what i meant in the applications tab of the Invoices form is this:
So i already have the data i need to update this particular field. So what i want is when the user inserts a line level row in the applications tab, to update the Total Credit Due field with the data that i obtain from my data view. My issue is this field doesn’t update.
It’s mostly the same as yours. Aside from some formatting changes (which are subjective), the difference is:
The extension is made to the ARInvoice. ARRegister is a parent class for it, but the Acumatica uses reflection to work with all customization extensions, so it might cause issues when Cache is being handled;
Calls to cache changed to use PXCache embedded into the PXView. Direct type calls can be ignored in some cases - Persist checks Caches from Views. If ARRegister and ARInvoice Caches are handled separately, this can cause issues;
You are using 2 options of setting the value at the same time. There’s no point in it. You can use Base.Document.SetValueExt<ARInvoiceExt.usrTotalCreditDue>(arInvoiceHeader, arInvoice.CuryOrigDocAmt - arInvoiceHeader.CuryDetailExtPriceTotal); instead of direct ext.UsrTotalCreditDue = arInvoice.CuryOrigDocAmt - arInvoiceHeader.CuryDetailExtPriceTotal; but they are doing the same.
Also, take a look at your implementation of the UsrTotalCreditDue. Some attributes are able to affect the process. In my example, I decorated the field with the bare minimum of the attributes.
Hello.
This customization is related to Sales Order Invoice. So how can i make the extension to ARInvoice ? Shouldn’t it be made to SOInvoice Entry ?
This is the extension i am using.
Please help. Struggling with this issue since weeks.
I meant to take my code, replace public class ARInvoiceEntryExt : PXGraphExtension<ARInvoiceEntry>with public class SOInvoiceEntryExt : PXGraphExtension<SOInvoiceEntry>
Since you want update field you added to the top form, you can use Base.Document.Current to get invoice that is selected in the top form (that’s to replace your logic to get arInvoiceHeader)
You can just compare my event with yours instead of copying everything - again, I tried to keep it similar to yours.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.