Anyone know of way to search for a customer location in a GI. In a report it’s simple because you can the customer and location in report parameters. AI generated a completely wrong solution saying use Location.LocationCD but Location is a 2 part key of BAccount and Location ID. For example, showing all payments for a sales order I can pass the customer and location to the GI but for the GI as a standalone query I cannot look up the location.
Selector for Customer Location as a GI Parameter
Best answer by Steve Milner
You're right that Location.LocationCD won't do it on its own. The code repeats across customers, and in the demo data MAIN alone appears 336 times in a single company, so a lookup has nothing to resolve to.
You don't actually need the two part key though. Point the parameter at the location field on the document rather than at the Location table. On a sales order that's SOOrder.CustomerLocationID, and most documents that carry a customer location have an equivalent field. LocationID is an identity column in the database, so no two customers share one, which means that single value identifies the location by itself.
From there it's the standard optional filter pair on the Conditions tab:
( SOOrder.CustomerLocationID Equals [Location] Or [Location] Is Empty )
Then add a Customer parameter against SOOrder.CustomerID the same way.
If it helps to have a working example to compare against, Acumatica's own Field Services inquiries are built exactly like this. FS-Service Order Details has a CustomerID parameter on FSServiceOrder.customerID and a CustomerLocationID parameter on FSServiceOrder.locationID.
The one thing you won't get is the location list narrowing to the customer you picked. Naveen covered that well here: https://community.acumatica.com/distribution-6/generic-inquiry-filter-relation-8258
Happy to compare notes if it behaves differently on your version.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.