Question

Add Print button in service order screen

  • 11 January 2023
  • 4 replies
  • 124 views

Userlevel 3
Badge

Hi Everyone,

I have a request here to add the print button,

scenario - If i have the below appointment list then print button should be enabled. If not then print button should be disabled.

 

I want to insert the print button here,

 

 

kindly pour your inputs and suggestions here.


4 replies

Userlevel 4
Badge +1

Hi @sujithra,

Please create an Action button which is required, and follow the below steps which are mentioned in the below screenshot.

Go to your customization project and select expand the required screen.

 

 

For Visible/disabled functionality, you can use the RowSelected Event handler.

 

I hope this may help you!

Moulali Shaik.

 

 

 

 

 

Userlevel 7
Badge +17

Hi @sujithra  As mentioned by MoulaliShaik, you can add the below logic in the RowSelected event to Visible/Invisible the report button. 

 

 

protected virtual void DACName_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
DACName row = e.Row as DACName;
if (row != null)
{
if(Base.View.Select().FirstTableItems.ToList().Count > 0)
{
ReportButton.SetEnabled(true);
}
else
{
ReportButton.SetEnabled(false);
}
}
}

 

Userlevel 3
Badge

Thanks for you response @MoulaliShaik79 . I have added the button however events are not showing after clicking on the required button. 

FYI : Print Appointment Test is the newly added button.

 

 

Userlevel 4
Badge +1

Hi @sujithra,

There you can not find any event handlers.

Please create a Graph Extension class and add the RowSelected Event Handler where you need to write disable/enable button logic. Please take the above code which is provided by @Naveen Boga Naveen as a reference.

 

FYI:

You can create the same DataView (with Different NewDataViewName) by copying and pasting the existing code from the Base Graph into your Graph Extension class.

      



​​​​

 

Check the count value below:

inside the RowSelected Handler.

if (NewDataViewName.Select().count > 0)

{

    // Button enable logic

}

else

{

   // Button disable logic

}

 

 

 

Hope it helps you!

Moulali Shaik.

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