如何启用自定义DAC选择器的AllowAddNew/AllowEdit功能?
I've run into this exact issue before with Acumatica selectors—when you enable AllowAddNew or AllowEdit but don't specify the associated maintenance graph, the buttons show up but do nothing because the system doesn't know where to direct the user for those actions. Here's how to resolve it:
Root Cause
Your selector on the UsrManagementCompany field in the ContactExt extension doesn't specify which graph should handle creating or editing UsrCustomerManagementCompany records. Even though you have a valid ManagementCompanyMaint graph, Acumatica can't automatically associate it with the selector unless you explicitly tell it to.
Step-by-Step Fix
1. Update the Selector Configuration
Modify the PXSelector attribute on your UsrManagementCompany field to include two critical settings:
AllowAddNew = trueandAllowEdit = true(you already tried this, but we need to pair it with...)PopupPage = typeof(ManagementCompanyMaint): This tells Acumatica which graph to open when the add/edit buttons are clicked.
Also, make sure the field length on UsrManagementCompany matches the MancompID field in your custom DAC (16 characters) to avoid data truncation issues.
Here's the corrected code for the ContactExt extension:
namespace PX.Objects.CR { public class ContactExt : PXCacheExtension<PX.Objects.CR.Contact> { #region UsrManagementCompany [PXDBString(16, IsUnicode = true)] // Match length of UsrCustomerManagementCompany.MancompID [PXUIField(DisplayName = "Management Company")] [PXSelector( typeof(Search<UsrCustomerManagementCompany.mancompID>), new Type[] { typeof(UsrCustomerManagementCompany.mancompID), typeof(UsrCustomerManagementCompany.mancompName) }, SubstituteKey = typeof(UsrCustomerManagementCompany.mancompName), AllowAddNew = true, AllowEdit = true, PopupPage = typeof(ManagementCompanyMaint) // Critical: Link to your maintenance graph )] public virtual string UsrManagementCompany { get; set; } public abstract class usrManagementCompany : IBqlField { } #endregion } }
2. Verify Permissions
Double-check that the user role accessing the Contact screen has access rights to the ManagementCompanyMaint screen. If the user doesn't have permission to open that graph, the add/edit buttons will still appear unresponsive even after adding the PopupPage setting.
Optional: Customize Popup Title
If you want to change the title of the popup window that opens when clicking add/edit, add the PopupTitle parameter to the selector:
PopupTitle = "Create/Edit Management Company"
Why This Works
The PopupPage property directly maps the selector to your custom maintenance graph. When a user clicks the "Add New" or "Edit" button in the selector, Acumatica launches the ManagementCompanyMaint screen in a popup, allowing the user to create or modify records seamlessly—just like you can do in the standalone screen.
内容的提问来源于stack exchange,提问作者Lauren Moylan

