Contents tagged with Filter

  • How to work with filters applied to grid in Acumatica

    Hello everybody,

    today I want to describe how to work with Filters, that applied to grid in Acumatica page.

    For demonstration purposes I'll use Requisition form. 

    So, first of all, I want to say that dealing with Filters you'll need .View.GetExternalFilters() method.

    At requisition form graph extension you can get it like this:

    List<PXFilterRow> filters = Base.Lines.View.GetExternalFilters()?.ToList() ?? new List<PXFilterRow>();

    Demonstrated line of code will give you list of applied filters, or empty list, if no filters were applied to grid.

    Take not on how filters look like in debugger:

    honestly speaking, applied filters look very similarly to applied ODATA protocol. On my … more

  • Filters in Acumatica

    Hello everybody,

    in this article I want to describe how filtering in Acumatica work. When I say filtering, I mean following UI part:

    In manuals T100 - T300 there is almost nothing about how filters work, so I want to share few bits of development information.

    Storage

    All information about filters is stored in database in tables FilterRow and FilterHeader.

    Take a look on screenshot of FilterInformation for some custom applied filter:

     

    As you can see from screenshot Acumatica stores information about filters by FilterID, and has information like Condition, values, Close brackets, operators and so on.

    Also there are DAC classes FilterRow and FilterHeader, but you can find them only … more

  • How to add Database context to Filter in .Net Core 2.0

    Hello everybody,

    today I want to write a short description on how to add database context to IAuthorizationFilter.

    Imagine that you have following filter:

    public class HasApprovedFilter : Attribute, IAuthorizationFilter

    {

        private SomeDbContext _context;

        public HasApprovedFilter(SomeDbContext context)

        {

            this._context = context;

        }

        public void OnAuthorization(AuthorizationFilterContext context)

        {

            var user = context.HttpContext.User;

            if (!user.Identity.IsAuthenticated)

            {

                return;

            }

            var userAdd = _context.;

            //var um = context.HttpContext.RequestServices.GetService();

        }

    } … more