Skip to main content
Solved

how to get the value of current BranchID

  • 4 December 2021
  • 3 replies
  • 924 views

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

Best answer by Naveen Boga

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

 

View original
Did this topic help you find an answer to your question?

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • Answer
  • December 4, 2021

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

 


  • Author
  • Varsity I
  • 32 replies
  • December 8, 2021
Naveen B wrote:

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.


Forum|alt.badge.img
  • Jr Varsity III
  • 47 replies
  • July 28, 2022

@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? 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings