Hi Team,
I have create a new processing screen and in view delegate trying to access a Use Defined Field value from Customer screen to show on UI and I am using 22.106.0015 build version.
I have referred some community posts but not been able to access the defined field value. Below are the samples I have verified:
- The customer’s user defined field value stored in BAccountKvExt table and in DB able to access it but in code not able to access this table.
- Access User Defined Field from business logic | Community (acumatica.com) from this community post tried to access using new cache object but that also does not helps.
public sealed class SOLineExt : PXCacheExtension<SOLine>
{
public static bool IsActive() { return true; }
#region UsrEmployer
public string UsrEmployer { get; set; }
public abstract class usrEmployer : PX.Data.BQL.BqlString.Field<usrEmployer> { }
#endregion
}
public class LineProcessMaint : PXGraph<LineProcessMaint>
{
#region Views
public PXCancel<SOLine> Cancel;
public PXProcessing<SOLine> KitAssemblyProcess;
#endregion
protected IEnumerable kitAssemblyProcess()
{
foreach (PXResult<SOLine, SOOrder, SOShippingContact, InventoryItem> result in PXSelectJoin<SOLine, InnerJoin<SOOrder, On<SOOrder.orderType, Equal<SOLine.orderType>, And<SOOrder.orderNbr, Equal<SOLine.orderNbr>>>,
InnerJoin<SOShippingContact, On<SOShippingContact.contactID, Equal<SOOrder.shipContactID>>,
InnerJoin<InventoryItem, On<InventoryItem.inventoryID, Equal<SOLine.inventoryID>>>>>,
Where<InventoryItem.kitItem, Equal<True>>, OrderBy<Desc<SOLine.orderNbr>>>.Select(this))
{
SOLine line = result;
SOOrder order = result;
SOShippingContact shippingContact = result;
InventoryItem inv = result;
SOLineExt lineExt = line?.GetExtension<SOLineExt>();
BAccount bAccount = PXSelect<BAccount, Where<BAccount.bAccountID, Equal<Required<BAccount.bAccountID>>>>.Select(this, order?.CustomerID);
PXCache cache = base.CachesBtypeof(BAccount)];
var attributeEMPLOYER = (PXStringState)cache.GetValueExt(bAccount, "AttributeEMPLOYER");
lineExt.UsrEmployer = attributeEMPLOYER;
}
}
}
Can you please review and help, Thank you in Advance !