Skip to main content
Question

Modifying the Global Search for Customers

  • December 3, 2022
  • 3 replies
  • 359 views

Forum|alt.badge.img+7

I’m trying to add the Postal Code for the customer (General tab) to the Global Search.  I thought that I could start with using MergeMethod.Replace but use the original definition from Customer.cs and change the heading (“zig zag”).

namespace PX.Objects.AR
{
  public class CustomerExt : PXCacheExtension<PX.Objects.AR.Customer>
  {
#region NoteID  
[PXMergeAttributes(Method = MergeMethod.Replace)]
[PXSearchable(SM.SearchCategory.AP | SM.SearchCategory.PO | SM.SearchCategory.AR | SM.SearchCategory.SO | SM.SearchCategory.CR, "Zig zag", new Type[] { typeof(Customer.acctName) },
new Type[] { typeof(Customer.acctName), typeof(Customer.acctCD), typeof(Customer.acctName), typeof(Customer.acctCD), typeof(Customer.defContactID), typeof(Contact.displayName), typeof(Contact.eMail),
typeof(Contact.phone1), typeof(Contact.phone2), typeof(Contact.phone3), typeof(Contact.webSite)},
NumberFields = new Type[] { typeof(Customer.acctCD) },
Line1Format = "{0}{2}{3}{4}", Line1Fields = new Type[] { typeof(Customer.acctCD), typeof(Customer.defContactID), typeof(Contact.displayName), typeof(Contact.phone1), typeof(Contact.eMail) },
Line2Format = "{1}{2}{3}", Line2Fields = new Type[] { typeof(Customer.defAddressID), typeof(Address.displayName), typeof(Address.city), typeof(Address.state)},
SelectForFastIndexing = typeof(Select2<Customer, InnerJoin<Contact, On<Contact.contactID, Equal<Customer.defContactID>>>>)
)]

public Guid? NoteID { get; set; }  
#endregion  
  
  }
}

When running the text-rebuild option I get a SQL error. The profiler showed that, indeed, some bad SQL was created.

Does anyone have any tips on how to make changes to the Customer global search settings?

3 replies

RaphaelPfaff12
Semi-Pro III

Forum|alt.badge.img+7
  • Author
  • Captain II
  • December 6, 2022

Thank you for your reply. I did try that method but when I try to pull up the NoteID column in the editor, two NoteID fields appear. I’m assuming one from Customer and one from BAccount. I think that confuses the editor and it decided to show nothing:

When changing NoteID for Customer, NoteID appears twice, likely because the same field exists in BAccount
The Original attributes panel is not filled with the existing NoteID attribute declaration.

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • March 15, 2023

Hi @Django  were you able to find a solution? Thank you!