Skip to main content
Answer

Bring field FullName of DefBillContactID->FullName to selector CustomerID

  • December 15, 2022
  • 2 replies
  • 125 views

Forum|alt.badge.img

Hello experts,

I want to add field FullName of DefBillContactID to selector of CustomerID

 

I use the following code but it doesn’t work.

        [PXCustomizeSelectorColumns(
typeof(PX.Objects.CR.BAccountR.acctCD),
typeof(PX.Objects.CR.BAccountR.acctName),
typeof(PX.Objects.CR.Address.addressLine1),
typeof(PX.Objects.CR.Address.addressLine2),
typeof(PX.Objects.CR.Address.postalCode),
typeof(PX.Objects.AR.CustomerAttribute.Contact.phone1),
typeof(PX.Objects.CR.Address.city),
typeof(PX.Objects.CR.Address.countryID),
typeof(PX.Objects.AR.CustomerAttribute.Location.taxRegistrationID),
typeof(PX.Objects.AR.Customer.curyID),
typeof(PX.Objects.AR.CustomerAttribute.Contact.attention),
typeof(PX.Objects.AR.Customer.customerClassID),
typeof(PX.Objects.AR.Customer.status),
typeof(PX.Objects.AR.Customer.defBillContactID),
typeof(PX.Objects.CR.Contact.fullName))]
[Customer(Visibility = PXUIVisibility.SelectorVisible, Filterable = true, TabOrder = 2)]
[PXRestrictor(typeof(Where<Customer.status, Equal<CustomerStatus.active>,
Or<Customer.status, Equal<CustomerStatus.oneTime>,
Or<Customer.status, Equal<CustomerStatus.hold>,
Or<Customer.status, Equal<CustomerStatus.creditHold>>>>>), Messages.CustomerIsInStatus,
typeof(Customer.status), typeof(InnerJoin<Contact, On<Customer.defBillContactID, Equal<Contact.contactID>>>))]
[PXUIField(DisplayName = "Customer", TabOrder = 2)]
[PXDefault()]

Could you please advise me?

I am wondering if it is possible to bring this field to Selector of CustomerID or not since it is in 2 level deep

 

Regards,

Khoi

Best answer by andriikravetskyi35

Hi everybody,

Maybe try to use this approach, in read I marked fields that I setup for selector look-up grid:

 

 public class SOOrderExt : PXCacheExtension<SOOrder>
    {
        public static bool IsActive() => true;

        [PXDBInt()]
        [PXUIField(DisplayName = "Customer My Selector")]
        [PXSelector(typeof(SearchFor<Customer.bAccountID>.In<
            SelectFrom<Customer>.InnerJoin<Contact>.On<Customer.defBillContactID.IsEqual<Contact.contactID>>>),

            typeof(Customer.acctCD), typeof(Customer.acctName), typeof(Contact.fullName),

            SubstituteKey = typeof(Customer.acctCD), DescriptionField = typeof(Customer.acctName))]
        public virtual int? UsrCustomer { get; set; }
        public abstract class usrCustomer : PX.Data.BQL.BqlInt.Field<usrCustomer> { }

    }

 

and also screent-shot how it looks, so you can setup any column in grid that you need.

 

2 replies

andriikravetskyi35
Jr Varsity I
Forum|alt.badge.img+1

Hi everybody,

Maybe try to use this approach, in read I marked fields that I setup for selector look-up grid:

 

 public class SOOrderExt : PXCacheExtension<SOOrder>
    {
        public static bool IsActive() => true;

        [PXDBInt()]
        [PXUIField(DisplayName = "Customer My Selector")]
        [PXSelector(typeof(SearchFor<Customer.bAccountID>.In<
            SelectFrom<Customer>.InnerJoin<Contact>.On<Customer.defBillContactID.IsEqual<Contact.contactID>>>),

            typeof(Customer.acctCD), typeof(Customer.acctName), typeof(Contact.fullName),

            SubstituteKey = typeof(Customer.acctCD), DescriptionField = typeof(Customer.acctName))]
        public virtual int? UsrCustomer { get; set; }
        public abstract class usrCustomer : PX.Data.BQL.BqlInt.Field<usrCustomer> { }

    }

 

and also screent-shot how it looks, so you can setup any column in grid that you need.

 


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • December 22, 2022

Hi @andriikravetskyi35,

thank you very much for your help.

I am able to bring field Full Name of DefBillContactID.