I am sorry I ask so many questions. I work alone and I don’t have anyone around to ask for help. I really do try to figure things out and not just ask a question as soon as something doesn’t work.
I want to add a selector to the Details grid on the Cash Sales screen. The Selector needs to pull related entities from the Relations tab on the Business Accounts screen.
These are the items I want to show up in the selector.
I’ve added the following UDF in the ARTran extension
#region UsrDonorBusAccountID
nPXDBInt]
IPXUIField(DisplayName = "Donor ID")]
DPXSelector(typeof(Search2<CRRelation.entityID,
InnerJoin<BAccount, On<BAccount.noteID, Equal<CRRelation.refNoteID>>>,
Where<CRRelation.refNoteID, Equal<BAccount.noteID>>>),
typeof(BAccount.bAccountID),
typeof(BAccount.acctCD),
DescriptionField = typeof(BAccount.acctCD))]
public virtual Int32? UsrDonorBusAccountID { get; set; }
public abstract class usrDonorBusAccountID : PX.Data.BQL.BqlInt.Field<usrDonorBusAccountID> { }
#endregion
This is what pops up when I click on the selector. I don’t know why Vendor is showing as the ID field and acctCD is probably due to my Selector not being valid.
From my looking into Acumatica, maybe I need some kind of CacheAttached code?
I tried this in the ARCashSaleEntry_Extension. I’m sure it is completely wrong, but I think it might be needed somehow.
PXSelector(typeof(Search2<CRRelation.entityID,
InnerJoin<BAccount, On<BAccount.noteID, Equal<CRRelation.refNoteID>>>,
Where<CRRelation.refNoteID, Equal<BAccount.noteID.FromCurrent>>>),
typeof(BAccount.bAccountID),
typeof(BAccount.acctCD),
DescriptionField = typeof(BAccount.acctCD))]
protected virtual void _(Events.CacheAttached<CRRelation.entityID> e) { }
Thanks to all of you for your help.