I created a custom smart panel to add data into my grid in my customized form. In my smart panel, it loads data from both POOrder and POline DAC’s. But the issue is when I select one item based on the orderNbr and click add button in my smart panel, all the values of same orderNbr get selected automatically and inserted into the grid.
I have no idea about this. Can someone help me to solve this ?
thank you.
below code snippet for the reference which I have defined to select and assign them into the fields of the grid.
public virtual IEnumerable InsertSelectedLines(PXAdapter adapter) {
if (POrdersView != null) { int lineNbr = Base.APProformaItems.Select().Count + 1;
foreach (PXResult<POOrder, POLine> result in POrdersView.Select()) { POOrder order = result; POLine line = result;
You can use Selected column from POLine DAC in your smart panel APSX code and in the graph instead of Selected column of POOrder DAC.
POLine line = result;
if (line.Selected == false) continue;
hi @EGolshtein67 ,
thank you for the response, I tested your suggestion but the issue is remained the same.
You can check APSX code of “Add PO Line” smart panel from Purchase Receipts (Screen ID PO302000) and use “AddPOOrderLine2” method of POReceiptEntry graph as example.
Hi there @EGolshtein67 ,
You have asked me to refer the business logic source of Purchase Receipts screen right? but I cannot see that there is “AddPOOrderLine2” method. How can I find it, Is there any other way to get into the POReceiptEntry graph code in the acumatica erp? It’s really appreciated if you can help me on this..
thank you.
Hi there,
The source code of Acumatica is located in this folder <your website>\App_Data\CodeRepository.
POReceiptEntry.cs file is in this folder <your website>\App_Data\CodeRepository\PX.Objects.PO.
I’ve noticed that you’re working on the exact same project and have the exact same problem as the post below. Are you on the same team? Should you just use one thread?
Correct me if I’m wrong but I feel like your question is more about the behaviour of the side panel than the code you’ve posted above.
Can you see if adding the line LineNbr field to the underlying query of the side panel helps (and perhaps OrderType and OrderNbr) from the POLine field?
hi @Django
sorry , I didn’t get your point, you mean to try out any other filed instead of LineNbr from POLine?
In the screenshot, I only see PO Number. But I think that you want to select individual rows from the PO, correct?
@Django
yes you are right, for example I can select and add first order from 000003 PO number because it has only one there, but when I select and try to add one order from 000002, all the other orders from the same PO number get selected, that is the issue.
Right - so maybe look to see if the issue can be resolved if you add, to the GI, the key fields of POLine. And make sure that your join between POOrder and POLine are correct.
I don’t know if that will help but if the system is treating all of the lines of 000002 as the same value, then you need to figure out why your GI is behaving that way.
Hi @Django ,
In my smart panel, actually, I have used a grid to load data from POOrder and POline. Below i have added the full code and the screenshots of the form for your reference.
The full code:
namespace GRIProformaInvoice.Extension { // Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active public class APProformaEntry_Extension : PXGraphExtension<APProformaEntry> {
public SelectFrom<POOrder>.InnerJoin<POLine>. On<POLine.orderNbr.IsEqual<POOrder.orderNbr>>.View POrdersView; //view to get data from POOrder and POLine
in the previous ,message, You have mentioned that we need to add key fields of POLine to the GI, But I didn’t get it because we haven’t used a GI here, so could you please clearly mention where should that modification be placed?
thank you.
This is a guess but try flipping your view so that POLine is the primary table.
And your join between the two tables is incorrect. The primary key on POOrder is orderType and orderNbr and the primary key on POLine is orderType, orderNbr, lineNbr.
public SelectFrom<POLine> .InnerJoin<POOrder>.On<POLine.orderNbr.IsEqual<POOrder.orderNbr> .And<POLine.orderType.IsEqual<POOrder.orderType>>> .View POrdersView
Hi @Django ,
thank you very much for the solution, now the issue is gone, I modified the view and the code as below and it worked. But now I got another one, when I gonna select and add another value from same Order Nbr, nothing is happened. I’m not allowed to add another PO from the same Order Nbr, Have I done something wrong in the code? below is the reference for you.
namespace GRIProformaInvoice.Extension { // Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active public class APProformaEntry_Extension : PXGraphExtension<APProformaEntry> {
public SelectFrom<POLine> .InnerJoin<POOrder>.On<POLine.orderNbr.IsEqual<POOrder.orderNbr> .And<POLine.orderType.IsEqual<POOrder.orderType>>> .View POrdersView;
I solved the issue, I have commented toBeInserted.POLineNbr mistakenly, because I have an event handler to check whether there is the same POnbr and POlineNbr going to be added to avoid duplicates, that was the issue in the last updated code, thank you all again for giving the guidance with solutions.