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
}
}