Skip to main content
Question

Action method behavior in graph extension of graph extension

  • March 21, 2024
  • 1 reply
  • 128 views

Tony Lanzer
Semi-Pro I
Forum|alt.badge.img+1

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

Tony Lanzer
Semi-Pro I
Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • 75 replies
  • March 21, 2024

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings