Global search the customer location

  • 26 July 2021
  • 1 reply

Userlevel 3
Badge +1

Is there a way to add the customer location into the global search.  As a field service company, the only thing we care about is the customer location because that is what all of our work is attached to.  Currently the global search doesn’t search for anything having to do with the customer location.


Best answer by Brian Stevens 26 July 2021, 22:22

View original

1 reply

Userlevel 6
Badge +4

This should be possible by a small customization.  If you have a developer resource, they can create a DAC extension in CR.Location on the NoteID field to add Location to the Global Search.  You will need to specify what fields you want searchable and displayed.  The potential downside is that the Location DAC is used for more than just customer locations, so if you only wanted customer locations, you will be getting more locations than you bargained for.

The PXSearchable attribute is what adds a DAC to the Universal (Global) Search.  The following is an example from the InventoryItem DAC on 2021R1.  Focus on just the PXSearchable attribute.  For this to be possible, the DAC (table) you want to include in the Universal Search must contain the NoteID field.  Also worth nothing, custom tables can be added with NoteID and added to Universal Search in the same way.  You will want to be sure run the Rebuild Full-Text Entity Index screen id SM209500 to populate the Universal Search.

#region NoteID
/// <summary>
/// Identifier of the <see cref="PX.Data.Note">Note</see> object, associated with the item.
/// </summary>
/// <value>
/// Corresponds to the <see cref="PX.Data.Note.NoteID">Note.NoteID</see> field.
/// </value>

[PXSearchable(SM.SearchCategory.IN, "{0}: {1}", new Type[] { typeof(itemType), typeof(inventoryCD) },
new Type[] { typeof(descr) },
NumberFields = new Type[] { typeof(inventoryCD) },
Line1Format = "{0}{1}{2}", Line1Fields = new Type[] { typeof(INItemClass.itemClassCD), typeof(INItemClass.descr), typeof(baseUnit) },
Line2Format = "{0}", Line2Fields = new Type[] { typeof(descr) },
WhereConstraint = typeof(Where<itemStatus.FromCurrent.IsNotEqual<InventoryItemStatus.unknown>>)

[PXNote(PopupTextEnabled = true)]
public virtual Guid? NoteID { get; set; }
public abstract class noteID : BqlGuid.Field<noteID> { }

When I researched this a few years ago, we had some discussion on Stack Overflow.  You can read that discussion here and see the example.


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