How would you filter rows out of GetRows()

at the moment I am trying to filter on a GLTracker GetRows() Method

DataSet dsChart = GLAdapter.GetRows("MainBook", "D", false, chart, today.Month > 3 ? today.Year + 1 : today.Year , "", cytPeriod < 6 ? "Main":"2ndHalf", out balance);

I am trying to filter out all of the reverse accruals which are located in the Journal detail table, I would need another parameter in the method to do this, so is there a easier way to filter the method or do I basically have to rewrite the method and add the parameter.

OR is there a better way of doing this. I am lost at the moment on how I can weed these accruals out of the totals that are inserted into GLTracker.

I have done some things in a post processing on GetRows (for other tables… not GL) where I did a BPM that simply removed the rows that we didnt want to show… for Vendor.GetRows, we wanted to hide a specific set… so we put the following line into a C# block:

ttVendorList.RemoveAll(ttVendorList_Row => ttVendorList_Row.GroupCode == "PTNR");

maybe you could do something similar to the returned rows from GLAdapter?

1 Like

The GL Tracker adds all of the data together for you by each period. by the GetRows, I can’t post process it cause there is nothing to remove just the values are incorrect because of the reversals. So what I did was a make a BAQ that gets the total cost of the reversed rows and added it on to the credit-debit I just don’t like doing it this way because it looks very sloppy.

dalps.ExecuteByID("CYT-Accrual-Ignore",qeds);
			decimal calculated_amount = 0;
			DataTable dt = dalps.QueryResults.Tables["Results"];
			if (dalps.QueryResults.Tables["Results"].Rows.Count > 0)
			{
				foreach (System.Data.DataRow r in dalps.QueryResults.Tables["Results"].Rows)
				{
					calculated_amount +=  Convert.ToDecimal(r["GLJrnDtl_DebitAmount"]) + Convert.ToDecimal(r["GLJrnDtl_CreditAmount"]);
				}

	
			}

			decimal cUsed = cDebit - cCredit + calculated_amount;

does this make sense.

@timshuwy I adapted this for CustCnt.GetRows and it works great on the Quote people tab where we don’t want users to select ShipTo contacts:

if (callContextClient.AssemblyName == "Erp.UI.QuoteEntry")
{
  result.CustCnt.RemoveAll(cc => cc.ShipToNum != "");
}

BUT the search screen is a little goofed up when there are lots of contacts and users have to hit the Next 100 button even though only 35 return in the search result… Trying to see if I can mess with that in the BPM, perhaps force a “return all rows” or something…

1 Like