I am trying to grab the Default Warehouse field in Stock Items screen and insert it to BOM Material grid (Warehouse) as shown below:
I tried overriding the field but failed to get the desired result by inserting the code is as shown below:
using PX.Data.ReferentialIntegrity.Attributes;
using PX.Objects.CM;
using System.Collections;
using PX.Data;
using PX.Objects.IN;
using System;
using System.Collections.Generic;
using System.Linq;
using PX.Objects.AM.Attributes;
using PX.Common;
using PX.Objects.CS;
using PX.Data.WorkflowAPI;
using PX.Objects;
using PX.Objects.AM;
namespace PX.Objects.AM
{
public class BOMMaint_Extension : PXGraphExtension<BOMMaint>
{
#region Event Handlers
[PXDefault(typeof(Search<InventoryItemCurySettings.dfltSiteID, Where<InventoryItem.inventoryID, Equal<Current<AMBomMatl.inventoryID>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
public abstract class siteID : PX.Data.BQL.BqlInt.Field<siteID> { }
protected Int32? _SiteID;
[PXRestrictor(typeof(Where<INSite.active, Equal<True>>), PX.Objects.IN.Messages.InactiveWarehouse, typeof(INSite.siteCD), CacheGlobal = true)]
[Site]
[PXForeignReference(typeof(Field<siteID>.IsRelatedTo<INSite.siteID>))]
public virtual Int32? SiteID
{
get
{
return this._SiteID;
}
set
{
this._SiteID = value;
}
}
protected virtual void AMBomMatl_SiteID_CacheAttached(PXCache cache)
{
}
#endregion
}
}
Best answer by mvolshteyn
View original