Skip to main content
Solved

How to modify print invoice button as a report dropdown button which contain list of reports(Template)

  • October 30, 2023
  • 1 reply
  • 60 views

Forum|alt.badge.img+1

Currently, a set of reports have been designed based on the type as Invoice, Debit Memo, Credit Memo and etc. Currently these reports can be accessed by the SO workspace menu items. Please check the below screenshot. 

Now user needs to directly run the appropriate report without navigating to workspace menu items. That means when user click the “PRINT INVOICE” button the pre designed set of report should be listed down like a dropdown and after selecting the relevant report, the report should be displayed.

So if you can provide guidance to perform this customization, it is highly appreciated. Thank you.

Best answer by darylbowman

 I believe you’re asking how to add a menu button which can hold other action buttons.

This code came from here

public MyGraph()
{
    MyMenu.AddMenuAction(Item1);
    MyMenu.AddMenuAction(Item2);
}        

public PXAction<SomeDAC> MyMenu;
[PXUIField(DisplayName = "My Menu")]
[PXButton(MenuAutoOpen = true)]
protected virtual IEnumerable inquiresMenu(PXAdapter adapter)
{
    return adapter.Get();
}

public PXAction<SomeDAC> Item1;
[PXUIField(DisplayName = "Item 1", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton]
public virtual IEnumerable item1(PXAdapter adapter)
{
    throw new PXException("Item 1 clicked!")
}

public PXAction<SomeDAC> Item2;
[PXUIField(DisplayName = "Item 2", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton]
public virtual IEnumerable item2(PXAdapter adapter)
{
    throw new PXException("Item 2 clicked!")
}

 

View original
Did this topic help you find an answer to your question?

1 reply

darylbowman
Captain II
Forum|alt.badge.img+13
  • 1712 replies
  • Answer
  • October 30, 2023

 I believe you’re asking how to add a menu button which can hold other action buttons.

This code came from here

public MyGraph()
{
    MyMenu.AddMenuAction(Item1);
    MyMenu.AddMenuAction(Item2);
}        

public PXAction<SomeDAC> MyMenu;
[PXUIField(DisplayName = "My Menu")]
[PXButton(MenuAutoOpen = true)]
protected virtual IEnumerable inquiresMenu(PXAdapter adapter)
{
    return adapter.Get();
}

public PXAction<SomeDAC> Item1;
[PXUIField(DisplayName = "Item 1", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton]
public virtual IEnumerable item1(PXAdapter adapter)
{
    throw new PXException("Item 1 clicked!")
}

public PXAction<SomeDAC> Item2;
[PXUIField(DisplayName = "Item 2", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton]
public virtual IEnumerable item2(PXAdapter adapter)
{
    throw new PXException("Item 2 clicked!")
}

 


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