Question

Modifying the Global Search for Customers

  • 3 December 2022
  • 3 replies
  • 173 views

Userlevel 7
Badge +5

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

Have you tried this?

https://asiablog.acumatica.com/2015/11/add-custom-field-to-full-text-universal-search.html

Userlevel 7
Badge +5

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.

 

Userlevel 7
Badge

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

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved