Skip to main content
Solved

Isse with PXSelector


I am new to Acumatica and am struggling to get a selector working in the purchase order screen. I want to add a customer field to the screen in the header area. I have created a custom field and want to use a selector to allow the user to choose the customer for the PO.

 

Here is the custom field:

        [PXDBString]
        [PXUIField(DisplayName = "Customer")]
        [PXSelector(typeof(SearchFor<Customer.bAccountID>
                             .In<SelectFrom<MOSCustomerProject>
                             .InnerJoin<BAccount>
                             .On<Customer.bAccountID.IsEqual<BAccount.bAccountID>>>),
                    new Type[] {
                        typeof(Customer.bAccountID),
                        typeof(BAccount.acctName)
                    },
                    DescriptionField = typeof(BAccount.acctName),
                    SubstituteKey = typeof(BAccount.bAccountID))]

The issue that I am having is that the selector does not get populated with the customers. If I manually put a customer’s bAccountID in the database field, the correct customer's name is displayed but opening the selector does not show the list of customers.

Best answer by Django

One of the challenges with BAccount is that it is used my Vendors as well. So when you have a second view in a graph that references BAccount, it will still “think” like the record your first BAccount view looks at (which is likely Vendors).

Try changing your selector to use BAccount2 or BAccountR and see if that helps.

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+6
  • Captain II
  • 573 replies
  • Answer
  • November 3, 2023

One of the challenges with BAccount is that it is used my Vendors as well. So when you have a second view in a graph that references BAccount, it will still “think” like the record your first BAccount view looks at (which is likely Vendors).

Try changing your selector to use BAccount2 or BAccountR and see if that helps.


Thank you for this. The selector now displays the customers.

Some additional questions:

  1. Where are the DACs documents? I can’t find anything about BAccount, BAccount2, etc.
  2. When I select a new customer and click the Select button, the bAccountID is displayed until I move away from the field. Can this just display the name?
  3. In the same DAC extension, can I reference a different field in the selector query? For example, the user selects a customer and then I want to populate another field with that customer’s projects.
  4. Is it best practice to put each customization in its own “project”, i.e. I have a customization the SO screen and another for the PO screen.
  5. Should all customizations for the same screen be in the same “project”?

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings