Solved

how to get the value of current BranchID

  • 4 December 2021
  • 3 replies
  • 690 views

Userlevel 2

Hi goog night.

 

I need to get the value of the current BranchId y use this propertie in my DAC.

    #region BranchID
public abstract class branchID : PX.Data.BQL.BqlInt.Field<branchID> { }
protected Int32? _BranchID;
[Branch()]
[PXDefault(typeof(AccessInfo.branchID))]

public virtual Int32? BranchID
{
get
{
return this._BranchID;
}
set
{
this._BranchID = value;
}
}
#endregion
In my screen i get the Br… (BranchID = 0)

can you help me please? thanks!!!

icon

Best answer by Naveen Boga 4 December 2021, 05:42

View original

3 replies

Userlevel 7
Badge +17

Hi @eddiedaco ,

If you wanted to assign the current Branch, you can use below code.

var getCurrentBranchID =  Base.Accessinfo.BranchID;

 

if you wanted to assign the current branch ID as a default value at DAC.

#region UsrBranchID   

[PXDBInt()]
[PXDefault(typeof(AccessInfo.branchID))]
public virtual Int32? UsrBranchID {get; set;}
public abstract class usrBranchID : PX.Data.BQL.BqlInt.Field<usrBranchID> { }

#endregion

 

Userlevel 2

Hi @eddiedaco ,

If you wanted to assign the current Branch, you can use below code.

var getCurrentBranchID =  Base.Accessinfo.BranchID;

 

if you wanted to assign the current branch ID as a default value at DAC.

#region UsrBranchID   

[PXDBInt()]
[PXDefault(typeof(AccessInfo.branchID))]
public virtual Int32? UsrBranchID {get; set;}
public abstract class usrBranchID : PX.Data.BQL.BqlInt.Field<usrBranchID> { }

#endregion

 

Hi @Naveen B  the client declined to use this field. I cant test it.

Userlevel 3
Badge

@Naveen Boga

Hi Naveen, do you know if it is possible to display in a report the branch id of the user pulling the report? 

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