Solved

Searching on selector get timeout

  • 13 March 2023
  • 6 replies
  • 80 views

Userlevel 3
Badge

Hi team,

I am doing customization on selector Customer ID on screen AR303000 to bring field Contact.fullName to selector view as following:

but I got error timeout when enter a text to search

The selector Customize ID is customized the field with following code:

using PX.Data;
using PX.Objects.CR;

namespace PX.Objects.AR
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
[PXNonInstantiatedExtension]
public class AR_Customer_ExistingColumn : PXCacheExtension<PX.Objects.AR.Customer>
{
#region AcctCD
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXSelector(typeof(Search2<Customer.acctCD,
InnerJoin<Contact, On<Customer.defBillContactID, Equal<Contact.contactID>>,
InnerJoin<Address, On<Contact.bAccountID, Equal<Address.bAccountID>>,
InnerJoin<Location, On<Address.addressID, Equal<Location.defAddressID>>>>>>),
typeof(Customer.acctCD),
typeof(Customer.status),
typeof(Customer.customerClassID),
typeof(Customer.acctName),
typeof(Contact.fullName),
typeof(Location.taxRegistrationID),
Filterable = true,
DescriptionField = typeof(Customer.acctCD))]
public string AcctCD { get; set; }
#endregion
}
}

 

it is weird because I used the same code to customize selector Customer on screen Payments and Applications and it works fine, doesn’t face timeout issue.

 

I attached source code (Customer_classLibrary) and package (Customer_customizationProject) so that you could address the issue easily

icon

Best answer by Naveen Boga 16 March 2023, 05:54

View original

6 replies

Userlevel 3
Badge

Hi @Naveen Boga 

thank you for your answer. I found that the duplication is come from InnerJoin between Localtion and Address by Address.addressID=Location.defAddressID

The Location should be linked to Customer by Customer.defLocationID and Customer.bAccountID.

Could you please explain what “BIZACCT” means in your code?

Userlevel 7
Badge +17

@mrthanhkhoi  I have modified the above selector and it is pulling the billing details properly.

For now, I have added this selector for the Sales Order screen, Customer ID field. You can modify it accordingly and verify.

 

   public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXUIField(DisplayName = "Customer ID")]
[PXDimensionSelector("BIZACCT",
typeof(Search2<BAccountR.bAccountID,
LeftJoin<Customer, On<Customer.bAccountID, Equal<BAccountR.bAccountID>>,

LeftJoin<Contact, On<Contact.bAccountID, Equal<Customer.bAccountID>, And<Contact.contactID, Equal<Customer.defBillContactID>>>,
LeftJoin<Address, On<Address.bAccountID, Equal<BAccountR.bAccountID>, And<Address.addressID, Equal<Customer.defBillAddressID>>>>>>,
Where<BAccountR.type, Equal<BAccountType.customerType>>>),
typeof(BAccountR.acctCD),
typeof(BAccountR.acctCD),
typeof(BAccountR.acctName),
typeof(BAccountR.type),
typeof(BAccount.parentBAccountID),
typeof(BAccount2.acctName),
typeof(BAccountR.classID),
typeof(BAccountR.status),
typeof(Contact.phone1),
typeof(Contact.eMail),
typeof(Address.addressLine1),
typeof(Address.addressLine2),
typeof(Address.city),
typeof(Address.state),
typeof(Address.countryID),
typeof(Address.postalCode),

DescriptionField = typeof(BAccountR.acctName))]

protected virtual void SOOrder_CustomerID_CacheAttached(PXCache sender)
{
}
}

 

Userlevel 7
Badge +17

Hi @mrthanhkhoi It seems this duplication issue causing with join, I can check this and let you know.

Userlevel 3
Badge

I also find that If I use same query InnerJoin to link table Contact, Address to Customer to modify columns in selector view on other screen (ex: Customer Details)

[PXSelector(typeof(Search2<Customer.acctCD,
InnerJoin<Contact, On<Customer.defBillContactID, Equal<Contact.contactID>>,
InnerJoin<Address, On<Contact.bAccountID, Equal<Address.bAccountID>>,
InnerJoin<Location, On<Address.addressID, Equal<Location.defAddressID>>>>>>),
typeof(Customer.acctCD),
typeof(Customer.status),
typeof(Customer.customerClassID),
typeof(Customer.acctName),
typeof(Contact.fullName),
typeof(Location.taxRegistrationID),
Filterable = true,
DescriptionField = typeof(Customer.acctCD))]

 Then the Customer has been duplicated.

Does anyone have idea?

Thanks

Userlevel 3
Badge

Hello @Naveen Boga ,

If I use your code, the field Account Name doesn’t take value from Account Name of Bill-to section

the expected result: the second column Account Name should be “test”

 

Userlevel 7
Badge +17

Hi, @mrthanhkhoi  I don’t think you need to write a new Selector for this.

Please use PXCustomizeSelectorColumns


[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXUIField(DisplayName = "Billing Customer")]
[PXCustomizeSelectorColumns(
typeof(Customer.acctCD),
typeof(Customer.acctName),
typeof(Customer.status),
typeof(Customer.customerClassID),
typeof(Contact.phone1),
typeof(Contact.fullName),
typeof(Address.addressLine1),
typeof(Address.addressLine2),
typeof(Address.city),
typeof(Address.state),
typeof(Address.countryID),
typeof(Address.postalCode)
)]
// [CustomerActive(DescriptionField = typeof(Customer.acctName))]
protected virtual void FSServiceOrder_BillCustomerID_CacheAttached(PXCache sender)
{
}

 

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