public INTransferEntry() { INSetup record = insetup.Current; PXUIFieldAttribute.SetVisible <INTran.tranType>(transactions.Cache, null, false); PXUIFieldAttribute.SetEnabled <INTran.tranType>(transactions.Cache, null, false); PXDimensionSelectorAttribute.SetValidCombo <INTran.subItemID>(transactions.Cache, true); PXDimensionSelectorAttribute.SetValidCombo <INTranSplit.subItemID>(splits.Cache, true); PXSelectorAttribute.SetColumns <INTran.subItemID>(transactions.Cache, new Type[] { typeof(INSubItem.subItemCD), typeof(INSiteStatus.qtyOnHand), typeof(INSiteStatus.active) }, null); PXSelectorAttribute.SetColumns <INTranSplit.subItemID>(splits.Cache, new Type[] { typeof(INSubItem.subItemCD), typeof(INSiteStatus.qtyOnHand), typeof(INSiteStatus.active) }, null); }
public override void CacheAttached(PXCache sender) { base.CacheAttached(sender); this.viewEmployees = new PXView(sender.Graph, true, BqlCommand.CreateInstance( typeof(Search5 <BAccountR.bAccountID, InnerJoin <EPEmployee, On <EPEmployee.bAccountID, Equal <BAccountR.bAccountID> >, LeftJoin <Contact, On <Contact.bAccountID, Equal <EPEmployee.parentBAccountID>, And <Contact.contactID, Equal <EPEmployee.defContactID> > >, LeftJoin <Address, On <Address.bAccountID, Equal <EPEmployee.parentBAccountID>, And <Address.addressID, Equal <EPEmployee.defAddressID> > >, LeftJoin <Users, On <Users.pKID, Equal <EPEmployee.userID> >, LeftJoin <EPCompanyTreeMember, On <EPCompanyTreeMember.userID, Equal <EPEmployee.userID> > > > > > >, Where <EPEmployee.userID, Equal <Current <AccessInfo.userID> >, Or <EPCompanyTreeMember.workGroupID, Owned <Current <AccessInfo.userID> > > >, Aggregate <GroupBy <BAccountR.bAccountID> > >))); this.viewCustomers = new PXView(sender.Graph, true, BqlCommand.CreateInstance(typeof(Search2 <BAccountR.bAccountID, InnerJoin <Customer, On <Customer.bAccountID, Equal <BAccountR.bAccountID> >, LeftJoin <Contact, On <Contact.bAccountID, Equal <Customer.bAccountID>, And <Contact.contactID, Equal <Customer.defContactID> > >, LeftJoin <Address, On <Address.bAccountID, Equal <Customer.bAccountID>, And <Address.addressID, Equal <Customer.defAddressID> > > > > >, Where <Match <Customer, Current <AccessInfo.userName> > > >))); this.viewClass = new PXView(sender.Graph, true, BqlCommand.CreateInstance( BqlCommand.Compose( typeof(Search <,>), typeof(RQRequestClass.reqClassID), typeof(Where <,>), typeof(RQRequestClass.reqClassID), typeof(Equal <>), typeof(Optional <>), reqClassID ?? typeof(RQRequestClass.reqClassID)))); if (this.reqClassID != null) { sender.Graph.FieldUpdated.AddHandler(BqlCommand.GetItemType(reqClassID), reqClassID.Name, ReqClassFieldUpdated); } PXUIFieldAttribute.SetDisplayName <BAccountR.acctCD>(sender.Graph.Caches[typeof(BAccountR)], Messages.Requester); PXUIFieldAttribute.SetDisplayName <BAccountR.acctName>(sender.Graph.Caches[typeof(BAccountR)], Messages.RequesterName); Type[] _fields = new Type[] { typeof(BAccountR.acctCD), typeof(BAccountR.acctName), typeof(BAccountR.status), typeof(Contact.phone1), typeof(Address.city), typeof(Address.countryID) }; string[] selFields = new string[_fields.Length]; string[] selHeaders = new string[_fields.Length]; for (int i = 0; i < _fields.Length; i++) { Type field = _fields[i]; Type cacheType = BqlCommand.GetItemType(field); PXCache cache = sender.Graph.Caches[cacheType]; if (cacheType.IsAssignableFrom(typeof(BAccountR)) || field.Name == typeof(BAccountR.acctCD).Name || field.Name == typeof(BAccountR.acctName).Name) { selFields[i] = field.Name; } else { selFields[i] = cacheType.Name + "__" + field.Name; } selHeaders[i] = PXUIFieldAttribute.GetDisplayName(cache, field.Name); } PXSelectorAttribute.SetColumns(sender, _FieldName, selFields, selHeaders); }