Solved

Extract Customer Data from General tab

  • 13 January 2022
  • 7 replies
  • 208 views

Userlevel 4
Badge +2

Hi,

I need to extract customer data inside my event that is called after user selects a definite payment

After payment was select, I pass the customerID from payment that was selected to Customer Search method

The fields that I can get for this entity are belong to header

How can I extract fields from the General tab ?

 

icon

Best answer by jinin 13 January 2022, 18:28

View original

7 replies

Userlevel 7
Badge +11

Hi @Ivan 

We need to use VIew to get the field values. 

For example, now you are in the payment extension graph. Payment graph related all views available in Base(payment) graph, We have the customerID field on the Payment and application screen itself.  So you should Use Base.Document.Current.CustomerID

 

 

Userlevel 4
Badge +2

Hi @Ivan 

We need to use VIew to get the field values. 

Now you are in the payment extension graph. The View is in the Base graph, We have the customerID field on the Payment and application screen itself.  So you should Use Base.Document.Current.CustomerID

 

 

Hi, jinin

I checked it earlier , but I did not give me what I need 

For example from this field Customer that is depicted on screen I need to extract “ABCHOLDING” value but it extracts  7061, which is internal ID, but I need “ABCHOLDING” value

When I tried to pas Base.Document.Current.CustomerID as parameter, the intellisense gives me error to Document after Base, and I can’t find what should be added

Userlevel 7
Badge +11

Hi @Ivan 

Try like below
 

 Customer cust = PXSelect<Customer, Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(Base, Base.Document.Current.CustomerID);

   
        Customer.UK.Find(Base, cust?.AcctCD);

Userlevel 4
Badge +2

Hi @Ivan 

Try like below
 

 Customer cust = PXSelect<Customer, Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(Base, Base.Document.Current.CustomerID);

   
        Customer.UK.Find(Base, cust?.AcctCD);

I can’t still access these such fields : zip, state, city, phone, adrres2, 

The only available field that I need to output is Adrress1

 

Userlevel 7
Badge +11

Hi @Ivan 

This BQL will provide you with the Contact, Address, and customer information.

            PXResult<Customer, Contact, LocationExtAddress> objCustomer = (PXResult<Customer, Contact, LocationExtAddress>)PXSelectJoin<Customer, LeftJoin<Contact, On<Customer.defContactID, Equal<Contact.contactID>>,
                           LeftJoin<LocationExtAddress, On<Customer.bAccountID, Equal<LocationExtAddress.locationBAccountID>>>>,
                           Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(Base, Base.Documents.Current.CustomerID)

            if (objCustomer != null)
            {
                Customer customer = objCustomer;
                Contact contact = objCustomer;
                LocationExtAddress address = objCustomer;

 

   // Write your code

}

 

 

Userlevel 6
Badge +5

You will want to use Customer.PK.Find if you are using the CustomerID, Customer.UK.Find is for the AcctCD(user friendly ID).

If you want the default address for the customer you can just use Address.PK.Find(Base, customer.defAddressID);

Userlevel 4
Badge +2

Hi @Ivan 

This BQL will provide you with the Contact, Address, and customer information.

            PXResult<Customer, Contact, LocationExtAddress> objCustomer = (PXResult<Customer, Contact, LocationExtAddress>)PXSelectJoin<Customer, LeftJoin<Contact, On<Customer.defContactID, Equal<Contact.contactID>>,
                           LeftJoin<LocationExtAddress, On<Customer.bAccountID, Equal<LocationExtAddress.locationBAccountID>>>>,
                           Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(Base, Base.Documents.Current.CustomerID)

            if (objCustomer != null)
            {
                Customer customer = objCustomer;
                Contact contact = objCustomer;
                LocationExtAddress address = objCustomer;

 

   // Write your code

}

 

 

Thank you vary much for your assistance

You helped me a lot

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