Question

Action method behavior in graph extension of graph extension

  • 21 March 2024
  • 1 reply
  • 65 views

Userlevel 4
Badge +2

I have a graph extension of the Project screen (ProjectEntry graph).  Included in this extension is a new view, and there is a new custom detail tab on the screen with a grid on it reading data from the new view.  In the grid, there is a column with a LinkCommand that calls an action method in the graph extension which opens a screen related to the column value.  This all works fine.

I also have an extension of this graph extension that overrides the view mentioned (adds joins to it) by simply redeclaring the view with the same name.  So far so good.  However, the link command mentioned above is still called as expected, but it fails to behave as expected.  Inside the action method, it expects the view to have a current record (the record in which the link was clicked), but the view doesn’t have one (it’s null).  The exact same code running from the first extension class, but now with an overridden view somehow causes the view to not know its record pointer; so it doesn’t know the value of the column that was clicked from inside the action method.

Graph extension 1 view:
 

public PXSelectJoin<CFPPKPMItemReq,
LeftJoin<POOrder, On<CFPPKPMItemReq.tranRefNbr,
Equal<POOrder.orderNbr>>>,
Where<CFPPKPMItemReq.projectID, Equal<Current<PMProject.contractID>>>>
CFPPKItemReqs;


Graph extension 2 view:
 

public PXSelectJoin<CFPPKPMItemReq,
LeftJoin<POOrder, On<CFPPKPMItemReq.tranRefNbr, Equal<POOrder.orderNbr>>,
LeftJoin<InventoryItem, On<CFPPKPMItemReq.inventoryID,
Equal<InventoryItem.inventoryID>>,
LeftJoin<INItemClass, On<InventoryItem.itemClassID,
Equal<INItemClass.itemClassID>>>>>,
Where<CFPPKPMItemReq.projectID, Equal<Current<PMProject.contractID>>>>
CFPPKItemReqs;


Graph extension 1 link action:
 

public PXAction<CFPPKPMItemReq> cFPPKOpenReleasedDocumentSO;
[PXButton(CommitChanges = true)]
public virtual IEnumerable CFPPKOpenReleasedDocumentSO(PXAdapter adapter)
{
CFPPKPMItemReq cFPPKPMItemReqRow = CFPPKItemReqs.Current; // null
return adapter.Get();
}


​​Without graph extension 2, the view’s Current property contains the active row clicked on.  With graph extension 2, it is null.

Any ideas why, or how to resolve?


1 reply

Userlevel 4
Badge +2

Instead of redeclaring the view in graph extension 2, I tried instead to add the joins in the graph extension 2 Initialize():
 

Base1.CFPPKItemReqs.Join<
LeftJoin<InventoryItem, On<CFPPKPMItemReq.inventoryID,
Equal<InventoryItem.inventoryID>>,
LeftJoin<INItemClass, On<InventoryItem.itemClassID,
Equal<INItemClass.itemClassID>>>>>();


Same bad behavior on link click.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved