On our Service Order Type I have Require Contact selected and have Take Address and Contact Information From: set to Contact. When creating a new service order would like the Primary Contact for the Customer select to come up as default. Is this possible to do with PXDefault? If so, how?
Make Customer Primary Contact the default on Service Orders
Best answer by vdiaz
Thanks for the question!
You're on the right track — it makes sense to expect the system to default the Primary Contact when "Require Contact" is checked and the source is set to Contact. But as you've probably noticed, Acumatica doesn’t handle this automatically out of the box.
Unfortunately, using [PXDefault] alone won’t work here. That attribute is great for setting simple default values, but it doesn’t support pulling related data like the customer's Primary Contact dynamically.
To get the behavior you're looking for, you’d need a small customization.
This would typically involve:
-
Extending the
ServiceOrderEntrygraph. -
Subscribing to the
RowSelectedorFieldUpdatedevent on theCustomerIDfield. -
Using BQL to retrieve the Primary Contact for the selected customer.
-
Setting the
ContactIDfield on the document accordingly.
I found youre question was already answered here:
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.