如何在Bills and Adjustments页面头部添加带自定义下拉操作的独立按钮?
Absolutely! You can totally add a standalone dropdown button with your custom actions to the header of the Bills and Adjustments page—matching the exact style of the existing "Actions" button—no need to cram your operations into the default dropdown. Here's how you can pull this off:
1. Locate the Page's Header Toolbar
First, find the header toolbar container where the existing "Actions" button lives. In Acumatica, this is almost always a PXToolbar control in the page's ASPX markup. You'll want to insert your new button right alongside it to keep the layout consistent.
2. Add the New Dropdown Button Control
Use the same PXSplitButton control that powers the default "Actions" dropdown. Drop this into the toolbar section of your ASPX file, right next to the existing button. Here's a quick example:
<px:PXSplitButton ID="btnCustomActions" runat="server" Text="Custom Actions" Key="CustomActions"> <MenuItems> <!-- Add your custom action items here --> <px:PXToolBarButton Text="Batch Export Invoices" CommandName="BatchExport" /> <px:PXToolBarButton Text="Mark as Reviewed" CommandName="MarkReviewed" /> </MenuItems> </px:PXSplitButton>
3. Wire Up Your Custom Actions in the Graph
Since you already know how to add actions to the default "Actions" dropdown, this part will feel familiar. In the page's graph (like APInvoiceEntry for Bills and Adjustments), define your custom actions and link them to the CommandName values you set in the ASPX:
public PXAction<APInvoice> batchExport; [PXButton(CommitChanges = true)] [PXUIField(DisplayName = "Batch Export Invoices")] protected void BatchExport() { // Your custom export logic here } public PXAction<APInvoice> markReviewed; [PXButton(CommitChanges = true)] [PXUIField(DisplayName = "Mark as Reviewed")] protected void MarkReviewed() { // Your custom status update logic here }
4. Match the Default Style
The PXSplitButton will automatically inherit the same styling as the default "Actions" button if it's placed within the same PXToolbar container. No extra CSS tweaks are usually needed—Acumatica's built-in styles will make it blend right in.
5. Adjust Placement (If Needed)
If you want to group buttons or tweak alignment, wrap your new button and the existing one in a PXToolbarGroup control. This ensures they stay aligned properly across different screen sizes.
A quick heads-up: Depending on your Acumatica version, the exact markup might have minor variations, but the core approach stays the same. Since you're already comfortable with customizing the default Actions dropdown, this should be a smooth process!
内容的提问来源于stack exchange,提问作者pmfith

