protected virtual void GetRecords()
        {
            PXCache cache   = this._Graph.Caches[BqlCommand.GetItemType(this.BatchModule)];
            object  current = null;

            foreach (object item in PXView.Currents)
            {
                if (item != null && (item.GetType() == BqlCommand.GetItemType(this.BatchModule) || item.GetType().IsSubclassOf(BqlCommand.GetItemType(this.BatchModule))))
                {
                    current = item;
                    break;
                }
            }

            if (current == null)
            {
                current = cache.Current;
            }

            PXView view = PXView.View;

            if (view != null)
            {
                if (_CuryID != null)
                {
                    object curyID = cache.GetValue(current, this._CuryID.Name) ?? cache.GetValuePending(current, _CuryID.Name);
                    PX.Common.PXContext.SetSlot(this._CuryID.FullName, curyID);
                }
                switch ((string)(cache.GetValue(current, this.BatchModule.Name) ?? cache.GetValuePending(current, this.BatchModule.Name)))
                {
                case GL.BatchModule.AP:
                    view.WhereNew <Where2 <Match <VendorR, Current <AccessInfo.userName> >, And <Where <BAccountR.type, Equal <BAccountType.vendorType>, Or <BAccountR.type, Equal <BAccountType.employeeType>, Or <BAccountR.type, Equal <BAccountType.combinedType>, Or <BAccountR.type, Equal <BAccountType.empCombinedType> > > > > > > >();

                    if (_CuryID != null)
                    {
                        Type join = BqlCommand.Compose(
                            typeof(InnerJoin <,>),
                            typeof(VendorR),
                            typeof(On <, ,>),
                            typeof(VendorR.bAccountID),
                            typeof(Equal <>),
                            typeof(BAccountR.bAccountID),
                            typeof(And <>),
                            typeof(Where <, ,>),
                            typeof(VendorR.curyID),
                            typeof(Equal <>),
                            typeof(SavedStringValue <>),
                            _CuryID,
                            typeof(Or <, ,>),
                            typeof(VendorR.allowOverrideCury),
                            typeof(Equal <>),
                            typeof(True),
                            typeof(Or <,>),
                            typeof(VendorR.curyID),
                            typeof(IsNull));

                        view.JoinNew(join);
                    }
                    else
                    {
                        Type join = BqlCommand.Compose(
                            typeof(InnerJoin <,>),
                            typeof(VendorR),
                            typeof(On <,>),
                            typeof(VendorR.bAccountID),
                            typeof(Equal <>),
                            typeof(BAccountR.bAccountID));

                        view.JoinNew(join);
                    }

                    break;

                case GL.BatchModule.AR:
                    view.WhereNew <Where2 <Match <CustomerR, Current <AccessInfo.userName> >, And <Where <BAccountR.type, Equal <BAccountType.customerType>, Or <BAccountR.type, Equal <BAccountType.combinedType>, Or <BAccountR.type, Equal <BAccountType.empCombinedType> > > > > > >();

                    if (_CuryID != null)
                    {
                        Type join = BqlCommand.Compose(
                            typeof(InnerJoin <,>),
                            typeof(CustomerR),
                            typeof(On <, ,>),
                            typeof(CustomerR.bAccountID),
                            typeof(Equal <>),
                            typeof(BAccountR.bAccountID),
                            typeof(And <>),
                            typeof(Where <, ,>),
                            typeof(CustomerR.curyID),
                            typeof(Equal <>),
                            typeof(SavedStringValue <>),
                            _CuryID,
                            typeof(Or <, ,>),
                            typeof(CustomerR.allowOverrideCury),
                            typeof(Equal <>),
                            typeof(True),
                            typeof(Or <,>),
                            typeof(CustomerR.curyID),
                            typeof(IsNull));

                        view.JoinNew(join);
                    }
                    else
                    {
                        Type join = BqlCommand.Compose(
                            typeof(InnerJoin <,>),
                            typeof(CustomerR),
                            typeof(On <,>),
                            typeof(CustomerR.bAccountID),
                            typeof(Equal <>),
                            typeof(BAccountR.bAccountID));

                        view.JoinNew(join);
                    }
                    break;
                }
            }
            //return null;
        }