Skip to main content
Solved

Add Custom Columns to InventoryID lookup in Sales Orders


Forum|alt.badge.img

I will need to do this in four different Graphs, but let’s start with the most common one: Sales Orders.

When entering an InvertoryID in Sales Order Detail (SOLine) Acumatica does a search inside VendorID --using the InventoryCD as well as Inventory Description-- as they enter the item:

 

My customer has two more fields they would like to also search on. But these fields do not exist in the default InventoryItem DAC. 

There is a post on StackOverflow that describes how to add columns to the search (I think) ...

public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
{
    public override void Initialize()
    {
        base.Initialize();
        //for InventoryID lookup
        CR.CRAttributesFieldAttribute.Activate(Base.Caches[typeof(InventoryItem)]);
        PXSelectorAttribute.SetColumns(Base.Caches[typeof(SOLine)],
          "InventoryID", new string[] { "InventoryCD", "Descr", "itemClassID", "Color_ATTRIBUTES" },
           new string[] { "InventoryCD", "Descr", "itemClassID", "$Attributes$-Color" });
    }
}        

 

-- But what if the fields were extended fields added to the InventoryItem DAC?

Or what if the field is an extension field added to the VENDOR DAC (linked via the PreferredVendor field)? 

How could I add this to the Inventory search? (If the second request is too complicated, I can just go with adding the two fields to the InventoryItem DAC.)

I’ve looked around but don’t see anything for this use case -- but I’m pretty sure that this must have been a need for someone else…

Does anyone know?

 

 

 

Best answer by dcomerford

@mjgrice32 Here is the package with it working you needed to set the FastFilterFields

 

View original
Did this topic help you find an answer to your question?

17 replies

Dioris Aguilar
Jr Varsity I
Forum|alt.badge.img+2

@mjgrice32 Try using PXCustomizeSelectorColumns attribute, here’s a guide on how to do that:
https://asiablog.acumatica.com/2015/10/customizing-selector-attributes.html


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 5, 2023
Dioris Aguilar wrote:

@mjgrice32 Try using PXCustomizeSelectorColumns attribute, here’s a guide on how to do that:
https://asiablog.acumatica.com/2015/10/customizing-selector-attributes.html

 

OK, I think I understand what you are saying. I’m going to go check. Thanks!

 

 

 

 


Forum|alt.badge.img+10
  • Semi-Pro III
  • 229 replies
  • October 6, 2023

Hi @mjgrice32 ,

If you want to add standard fields to the selector, you can follow below link to achieve the same.

Add standard field to the selector/lookup of Acumatica - Acumatica – Tips, Tricks and Components (greytrix.com)

Hope, it helps!

Regards,

Sweta


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 14, 2023

OK, I have had some time to come back around to this and it still is not working.

There are two solutions here, and I am a little confused about how they are supposed to be used. 

In ]the post suggested by Sweta68 ( add-standard-field-to-the-selector) the adding is done via the IIS App. When I follow the steps (as best as I can since the versions seem different) I end up with this:

Which gives me this when I run it:

But It can’t find anything when I search with the extended description:

 

I feel like I am missing a step. Isn’t there some method or event I need to override, or something?


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • October 14, 2023

@mjgrice32  Please review below article which helps you to solve this problem.

https://asiablog.acumatica.com/2017/05/filtering-inventory-items-by-new-field.html


dcomerford
Captain I
Forum|alt.badge.img+15
  • Captain I
  • 583 replies
  • October 16, 2023

The PXCustomiseSelectorColumn only adds the column to the search grid so they can be used to filter the list using the column filters. If you want the standard search box to search through these columns then you will need to use the FastFilterFields to set which fields to search when you enter a value in the search box see below i have added ItemClass (you can use a comma to add multiple fields the help has an example. It is under the Level below the Grid Transactions

 

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 17, 2023

For some reason, this just isn’t working for me. I read through the Asia blog, @Naveen Boga  sent, and I see @dcomerford reply, but… no luck here. 

Here is the code change I made after reading the Asia blog:

  public class InventoryItemExt : PXCacheExtension<PX.Objects.IN.InventoryItem>
  {
    #region UsrASGVendorXRef
    [PXDBString]
    [PXUIField(DisplayName = "Vendor CrossRef", Visibility = PXUIVisibility.SelectorVisible)]
    public virtual string UsrASGVendorXRef{ get; set; }
    public abstract class usrASGVendorXRef: PX.Data.BQL.BqlString.Field<usrASGVendorXRef> { }
        #endregion

And this is the change I made in the customization:

 

But when I search for this item by InventoryCD it finds it fine:

And when I search for it using the extended field… nothing.

I shut IIS down and restarted it. I refreshed the app pool. But nothing is working.

What am I doing wrong?

 

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 18, 2023

@dcomerford What version of Acumatica are you running?

(I am on 2022 R2, and I am wondering if it just doesn’t work in this version...)

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 18, 2023
Naveen Boga wrote:

@mjgrice32  Please review below article which helps you to solve this problem.

https://asiablog.acumatica.com/2017/05/filtering-inventory-items-by-new-field.html

That didn’t work for me, either. I literally copied his code and followed his steps, and no luck. 

I note that the post was from a few years ago. I am starting to wonder if this is a version problem?

 


dcomerford
Captain I
Forum|alt.badge.img+15
  • Captain I
  • 583 replies
  • October 18, 2023

@mjgrice32 I have it working on a site back to 21R1 so sure it is not a version issue. Can you send me your package and i can have a look. You do not need to do any ‘coding’ to make this work.


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 18, 2023
dcomerford wrote:

@mjgrice32 I have it working on a site back to 21R1 so sure it is not a version issue. Can you send me your package and i can have a look. You do not need to do any ‘coding’ to make this work.

Thank you so much!

Sure, here it is. It includes the database scripts to create the extended tables, and the changes I made to Sales Order screen. This is the one that tried to replicate Sergey’s example exactly. 

If you need the source code, LMK. There is nothing in it that is proprietary, this is just me trying to figure out how to do this.

Thanks again!


dcomerford
Captain I
Forum|alt.badge.img+15
  • Captain I
  • 583 replies
  • Answer
  • October 19, 2023

@mjgrice32 Here is the package with it working you needed to set the FastFilterFields

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 19, 2023

@dcomerford  OK… but I did that.

 

And, I was trying to add it in Sales Orders, actually, not Sales quotes. Did you see what I had done there? Did I define it incorrectly, or why isn’t it working in Sales Orders?


dcomerford
Captain I
Forum|alt.badge.img+15
  • Captain I
  • 583 replies
  • October 19, 2023

@mjgrice32 You did not have the FastFilterFields set on the InventoryID under the level on the Sales Order or the Selector Columns hence why i did the Sales Quote but here is package with it for the Sales Order and it is working

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 19, 2023

@dcomerford : First of all, thank you very much for your help.

I see I was doing my FastFilterFields in the wrong place. I was doing it in the Grid instead of the Level section. Thanks for that clarification.

 

However, none of these work in the detail line on the sales quotes (nor the Sales Orders) screen. In the default behavior, when the user is entering a value in the InventoryID field, the can automatically get the value, without needing the popup. This works (using an InventoryCD)  :

 

 

And this (using the extended field) does not:

Even though it does via the popup box:

 

So, to get that behavior, do I have to write my own verify function on the field and do the lookup myself then?


Forum|alt.badge.img
  • Author
  • Varsity I
  • 75 replies
  • October 23, 2023

@dcomerford I’m curious, what version of Acumatica were your running when you created the package you sent me?


dcomerford
Captain I
Forum|alt.badge.img+15
  • Captain I
  • 583 replies
  • October 23, 2023

It was 23R2 my latest test system


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings