Skip to main content
Solved

How to Customize Grid View of Inventory Lookup in Sales Order


Forum|alt.badge.img

I need to populate all the “S - Service items” which are in inventoryitem table (related Sql is below). How can I customize it?

select *
from inventoryitem
where ItemType = 's';

-------------------------------------------

Used Acumatica version - 22.111

Used data set - I100

No customizations published

Best answer by slesin

Hi @rashmikamudalinayake10,

unfortunately, the Add Item dialog is not customizable, because it uses a legacy approach of logic generalization -- it is a descendant of PXSelectBase, and they are not customizable at all. You could try to create a descendant of the SOSiteStatusLookup<Status, StatusFilter> class, and replace the original view with it (by creating a graph extension that contains a new class as a view with the exact name, that is used in SOOrderEntry -- sitestatus, and probably override these two actions: AddInvBySite and AddInvSelBySite). However, since this class have a very small amount of virtual members, this might not help the situation.

Acumatica have plans to refactor this functionality and move it to a graph extension approach, what would simplify the customization drastically. Please report a support request for such a change, if you would like to have an ability to customize that dialog easily.

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

6 replies

slesin
Acumatica Employee
Forum|alt.badge.img
  • Acumatica Employee
  • 9 replies
  • Answer
  • April 27, 2023

Hi @rashmikamudalinayake10,

unfortunately, the Add Item dialog is not customizable, because it uses a legacy approach of logic generalization -- it is a descendant of PXSelectBase, and they are not customizable at all. You could try to create a descendant of the SOSiteStatusLookup<Status, StatusFilter> class, and replace the original view with it (by creating a graph extension that contains a new class as a view with the exact name, that is used in SOOrderEntry -- sitestatus, and probably override these two actions: AddInvBySite and AddInvSelBySite). However, since this class have a very small amount of virtual members, this might not help the situation.

Acumatica have plans to refactor this functionality and move it to a graph extension approach, what would simplify the customization drastically. Please report a support request for such a change, if you would like to have an ability to customize that dialog easily.


  • Freshman I
  • 3 replies
  • August 23, 2024

I was able to do this in 23r2 by redeclaring the PXProjection with a different name, and redeclaring the data view using the new PXProjection. I also needed to override the Add Item methods. I have a problem now that we need to do this in 24r1 but the “sitestatus” data view is gone. How do we override this data view now? Thanks.


slesin
Acumatica Employee
Forum|alt.badge.img
  • Acumatica Employee
  • 9 replies
  • August 27, 2024

@JCombate84 the “sitestatus” is moved to the PX.Objects.Extensions.AddItemLookup.SiteStatusLookupExt<TGraph, TDocument, TLine, TItemInfo, TItemFilter> generic extension class, and now it’s called “ItemInfo”


  • Freshman I
  • 3 replies
  • August 27, 2024
slesin wrote:

@JCombate84 the “sitestatus” is moved to the PX.Objects.Extensions.AddItemLookup.SiteStatusLookupExt<TGraph, TDocument, TLine, TItemInfo, TItemFilter> generic extension class, and now it’s called “ItemInfo”

Is it possible to override that data view in a SOOrderEntry graph extension?


slesin
Acumatica Employee
Forum|alt.badge.img
  • Acumatica Employee
  • 9 replies
  • August 27, 2024

@JCombate84,

The PX.Objects.Extensions.AddItemLookup.SiteStatusLookupExt<TGraph, TDocument, TLine, TItemInfo, TItemFilter> generic extension has a terminal descendant for the SOOrderEntry graph: PX.Objects.SO.GraphExtensions.SOOrderEntryExt.SOOrderSiteStatusLookupExt.

Start with a higher-level extension:

public class MySOSiteStatusLookupChanges : PXGraphExtension<SOOrderSiteStatusLookupExt, SOOrderEntry>

{

}


Forum|alt.badge.img

We did a similar customization on the SOOrderEntry Graph.  We created a new Dac inherited from the SOSiteStatusSelected DAC that dac selected from a custom table for some fields.  Didn’t change the structure just where the fields pulled from, modified the Projection View associated with it (adding that custom table) then used PXSubstitute to switch projection views.  On top of that we modified the definition of the SiteInfo variable for the view in the Graph (yes I know now its called ItemInfo now thanks)  

Now I modified it to inherit from SOOrderSiteStatusSelected DAC due to new updates.  Did the same with the view and PXSubsitute to switch.  But when it comes to updating the ItemInfo… Its not visible in Base on a new Extension of SOOrderEntry.  So I tried you entry point from above:  PXGraphExtension<SOOrderSiteSatusLookupExt, SOOrderEntry>   and now its not in Base but it is in Base1.ItemInfo.  Every time I replace the view (ItemInfo) using the Initialize Event and just setting it like below: 

[PXFilterable]

[PXCopyPasteHiddenView]

public FbqlSelect<SelectFromBase<SOOrderSiteStatusSelected, PX.Common.TypeArrayOf<IFbqlJoin>.Empty>, SOOrderSiteStatusSelected>.View ItemInfo;

public override void Initialize()

{           

    base.Initialize();

    base.Base1.Initialize();

    Base1.ItemInfo.View = this.ItemInfo.View;

}

 

But when I do this the RowSelected Event on the SOOrderSiteStatusLookupExt Extension starts blowing up.  Even though it is an event on SOOrderSiteStatusSelected (see below code right out of it) it is evaluating e.Row like its SOOrder.  It then generates a type conversion.  Also I cannot override the event, the one below keeps executing even when I try to drop it. 

 

protected virtual void _(Events.RowSelecting<SOOrderSiteStatusSelected> e)

{

               if (e.Cache.Fields.Contains(typeof(SOOrderSiteStatusSelected.curyID).Name) &&

                                             e.Cache.GetValue<SOOrderSiteStatusSelected.curyID>(e.Row) == null)

               {

                              PXCache orderCache = e.Cache.Graph.Caches<SOOrder>();

                              e.Cache.SetValue<SOOrderSiteStatusSelected.curyID>(e.Row,

                                             orderCache.GetValue<SOOrder.curyID>(orderCache.Current));

                              e.Cache.SetValue<SOOrderSiteStatusSelected.curyInfoID>(e.Row,

                                             orderCache.GetValue<SOOrder.curyInfoID>(orderCache.Current));

               }

}

 

Any thoughs would be appreciated. 

 


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