关于修改Acumatica系统ARInvoice模块Project/Contract搜索字段描述及显示格式的技术咨询
Hey there! Let's break down your two Acumatica customization questions with practical, actionable steps:
1. Can I modify the description text of the Project/Contract search field on ARInvoice?
Absolutely you can! You’ve got two straightforward options depending on whether you want the change to apply globally or just to the AR Invoice screen:
- Screen-specific change (only affects AR301000)
- Fire up the Acumatica Customization Editor and load the AR Invoice screen (AR301000)
- In the Layout Editor, locate the Project/Contract field (it maps to
ProjectIDin the ARInvoice DAC) - Select the field, then in the right-hand properties panel, find the
DisplayNameattribute. Type in your desired label text, save your customization, and publish it. Done!
- Global change (appears everywhere this field is used)
- In the Customization Editor, navigate to the
ARInvoiceDAC and find theProjectIDfield - Look for the
[PXDisplayName]attribute on the field—by default it’s set to "Project/Contract". Update the parameter inside the brackets to your new label (e.g.,[PXDisplayName("Custom Project Label")]) - Save and publish your customization. Every screen that uses this field will now show your updated description.
- In the Customization Editor, navigate to the
2. Can I change the Project/Contract search result format from "ProjectID - ProjectDescription" to "ProjectID - CustomerName"?
Yep, this is totally doable by adjusting the selector logic for the ProjectID field. Here’s how:
The default selector for ProjectID pulls in the project ID and its internal description. To swap the description for the customer name, we need to join the Project table with the Customer (BAccount) table and adjust the display formatting:
- Open the Customization Editor and go to the
ARInvoiceDAC’sProjectIDfield - The existing
[PXSelector]attribute looks something like this:[PXSelector(typeof(Search<PMProject.contractID>), typeof(PMProject.contractCD), typeof(PMProject.description), SubstituteKey = typeof(PMProject.contractCD), DescriptionField = typeof(PMProject.description))] - Modify the selector to join with
BAccountand use the customer name for display. If you’re using a newer Acumatica version (2021+), you can use the LINQ-style query syntax for clarity:[PXSelector( typeof(SelectFrom<PMProject> .InnerJoin<BAccount>.On<PMProject.customerID.IsEqual<BAccount.bAccountID>> .Where<PMProject.contractID.IsNotNull>), typeof(PMProject.contractCD), typeof(BAccount.acctName), SubstituteKey = typeof(PMProject.contractCD))] [PXUIField(DisplayName = "Project/Contract")] [PXStringFormat(Format = "{0} - {1}", Fields = new[] { typeof(PMProject.contractCD), typeof(BAccount.acctName) })] - If you only want this change to apply to the AR Invoice screen (not globally), you can make this adjustment directly in the screen’s field properties instead of modifying the DAC. Just find the ProjectID field in the AR301000 screen layout, edit its
Selectorproperty, and apply the same logic. - Save and publish your customization. Now when you click the search icon for Project/Contract on the AR Invoice page, the results will show as
[ProjectID] - [CustomerName].
内容的提问来源于stack exchange,提问作者Андрей
相关产品推荐
相关产品推荐

