How can I override the 'Location ID' link to open CR Locations instead of AR Locations?

  • 9 March 2022
  • 5 replies

Badge +9

It would make sense to me that when opening a Location from the ‘Locations’ tab of a Business Account, that CR Locations would open by default. However, it does not, and AR Locations opens instead.

I must admit, I cannot even find where the code is that runs when this is clicked. I believe it executes an Action called ‘ViewLocation’, but I can’t find it and I don’t know how to override it.


Best answer by darylbowman 15 March 2022, 19:56

View original

5 replies

Userlevel 7
Badge +17

Hi, @darylbowman  Yes, LocationID Link action called as “ViewLocation” and the code is available under the LocationDetailsExt.cs file. 

Please find the screenshot below for reference.



Badge +9

I saw that, but it didn’t make sense why that would be opening in the AR Locations page.

Userlevel 7
Badge +17

Oh Okay!!

If Business Account is NOT extended as a Customer OR Vendor, then it will be redirected to the CR Locations

  • If Business Account is extended as a Customer then the system will take you to the Customer Locations i.e. AR Locations.
  •  If Business Account is extended as Vendor then the system will take you to the Vendor Locations i.e. AP Locations.


Badge +9

I guess this makes sense, but CR Location is really what I want to see. How can I override this?

Badge +9

This isn’t the way I was expecting to solve this need, but here’s what I did:

I added a new Action which opens CR Locations:

public class BusinessAccountMaint_Extension : PXGraphExtension<BusinessAccountMaint>
// Change in what window Locations opens
public PXAction<BAccount> CstViewLocation;
[PXUIField(DisplayName = PX.Objects.CR.Messages.ViewLocation, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = false)]
[PXButton(ImageKey = PX.Web.UI.Sprite.Main.DataEntry)]
public IEnumerable cstViewLocation(PXAdapter adapter)
BAccount bAccount = Base.Caches[typeof(BAccount)].Current as BAccount;

if (Base.BaseLocations.Current is object && bAccount is object && Base.Caches[typeof(BAccount)].GetStatus(bAccount) != PXEntryStatus.Inserted)
PX.Objects.CR.Standalone.Location current = Base.BaseLocations.Current;
LocationMaint graph = PXGraph.CreateInstance<AccountLocationMaint>();
graph.Location.Current = graph.Location.Search<PX.Objects.CR.Standalone.Location.locationID>(current.LocationID, bAccount.AcctCD);
PXRedirectHelper.TryRedirect(graph, PXRedirectHelper.WindowMode.NewWindow);

return adapter.Get();


Then I changed the Location ID ‘Link Command’ to use my custom Action:



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 — 2023  Acumatica, Inc. All rights reserved