Solved

Bring field FullName of DefBillContactID->FullName to selector CustomerID

  • 15 December 2022
  • 2 replies
  • 100 views

Userlevel 3
Badge

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

icon

Best answer by andriikravetskyi35 15 December 2022, 18:32

View original

2 replies

Userlevel 5
Badge +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.

 

Userlevel 3
Badge

Hi @andriikravetskyi35,

thank you very much for your help.

I am able to bring field Full Name of DefBillContactID.

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved