Today want to share with you one new way how you can define navigation in Acumatica version 5.3.
<px:PXGridColumn DataField="ProductID" Width="140px" LinkCommand="ViewProduct" />
But to be able to use it, you should define action, action handler, throw appropriate exception, hide it in data source and so on. Quite log and boring.
In Acumatica 5.3 there is a PXViewDetailsButtonAttribute that can do all these things for you.
public PXSelectReadonly<CROpportunit> Opportunities;
This attribute will do following:
- Will add dynamic action with name <DataView_Name>_<DAC_Name>_ViewDetails. So in our example it will be Opportunities_BAccount_ViewDetails and Opportunities_Contact_ViewDetails.
- Will add an action handler where it will search for required entity based on provided BQL and do redirect.
- Will hide dynamic action in data sources.
So as the result you just can go to aspx file and use it!
<px:PXGridColumn DataField="OpportunityID" />
In the result you code is cleaner and the result is nicer.
Also note that you may have multiple PXViewDetailsButton attributes that will generate multiple buttons.
As an addition you can configure action behavior with attribute properties:
- Custom action name by explicitly specifying it
- Window open mode: popup or window
- What to do when popup is closed - refresh data for example.
Have a nice Development!