Skip to main content
Answer

BusinessAccountMaint Extenstion DefLocationAddress view

  • August 2, 2023
  • 2 replies
  • 87 views

Forum|alt.badge.img+1

I’m working on a customization to disable editing of Business Accounts under certain conditions.

I have it working for most portions of the screen with the following code, but I cannot figure out how to access the DefLocationAddress view from my extenstion.

Looking at the Acumatica source, it looks like that portion is implemented in an extension.

Any idea how I can access that view from my extenstion to disable it?

 

PXUIFieldAttribute.SetEnabled(e.Cache,row,false);
PXUIFieldAttribute.SetEnabled(Base.Caches<Address>() , Base.AddressDummy.Current, false);
PXUIFieldAttribute.SetEnabled(Base.Caches<Contact>(), Base.ContactDummy.Current, false);
PXUIFieldAttribute.SetEnabled(Base.Caches<CSAnswers>(), Base.Answers.Current, false);
PXUIFieldAttribute.SetEnabled(Base.Caches<CR.Standalone.Location>(), Base.BaseLocations.Current, false);

Thanks

Scott

 

Best answer by Zoltan Febert

This is what I use in my VendorMaint extension, something similar should work for you as well.

var defLocationExt = Base.GetExtension<VendorMaint.DefLocationExt>();
defLocationExt.DefLocationAddress.AllowUpdate = false;

2 replies

Zoltan Febert
Jr Varsity I
Forum|alt.badge.img+3
  • Jr Varsity I
  • Answer
  • August 2, 2023

This is what I use in my VendorMaint extension, something similar should work for you as well.

var defLocationExt = Base.GetExtension<VendorMaint.DefLocationExt>();
defLocationExt.DefLocationAddress.AllowUpdate = false;

Forum|alt.badge.img+1

zfebert56, 

Thanks for your help, that did the trick.