Question

Auto-Fill Restrict Visibility

  • 11 June 2024
  • 0 replies
  • 19 views

Userlevel 2
Badge

We have two companies, soon to be three, setup on Acumatica and they do not share customers at all. We have been using the “Restrict Visibility” field to make it so that employees can only access customers that are a part of their company. Unfortunately, people forget to fill in this field all the time, leading us to have to go through manually figuring out what company they belong to every now and then. I looked into trying to auto-fill this field using customer classes, but the customer classes are shared between companies, so that’s not an option. I decided to turn to coding and try to use PXDefault to pull the branch/company from what the user is signed into, but I can’t get it to work and it just keeps throwing the following error. If anyone could give me a hand, that would be great.

The multi-part identifier "Customer.COrgBAccountID" could not be bound.

 

Here is my code

namespace PX.Objects.AR
{
[PXNonInstantiatedExtension]
public class AR_Customer_ExistingColumn : PXCacheExtension<PX.Objects.AR.Customer>
{
#region COrgBAccountID
[PXDefault(typeof(Search2<Organization.bAccountID, LeftJoin<Branch, On<Branch.organizationID, Equal<Organization.organizationID>, And<Branch.branchID, Equal<Current<AccessInfo.branchID>>>>>>))]
public int? COrgBAccountID { get; set; }
#endregion
}
}

 


0 replies

Be the first to reply!

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