Loading ...

SelectFrom For Usage In View Select

Hello everybody,

I want to leave a short note on how to use SelectFrom for legacy code, and pass it in View.Select for Acumatica newer versions. 

var cmd = new SelectFrom<PartsCatalog>.
    InnerJoin<INSiteStatus>.On<Use<PartsCatalog.inventoryID>.AsInt.IsEqual<Use<INSiteStatus.inventoryID>.AsInt>>.View(this);
 
var s = (currentFilter.PageNbr ?? 0) * (currentFilter.PageSize ?? 0);
int startRow = s > 0 ? s : PXView.StartRow;
int totalRows = 0;
int maxRows = (currentFilter.PageSize ?? 0) == 0 ? PXView.MaximumRows : currentFilter.PageSize ?? 0;
 
var list = cmd.View.Select(new[] { currentFilter }, nullPXView.Searches,
    PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRowmaxRowsref totalRows).ToList();

As you can see, each time, when field is not converted to a newer Acumatica FBQL, you can refer to Use and AsType.

Be the first to rate this post

  • Currently 0.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5