What does BOReader return?

I have a question for the experts out there.

What does BOReader return, being more specific than a DataSet.

As an example, if one were to use BOReader for SalesOrder, does it return ALL tables that are in the normal SalesOrderDataSet or just the OrderHead table?

Someone will surely correct me if I’m wrong, but I believe it returns all the tables of the BO. Then to access them, you call the specific table by name with the GetList method

using(BOReaderImpl boReader = WCFServiceSupport.CreateImpl<Ice.Proxy.Lib.BOReaderImpl>((Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BOReaderSvcContract>.UriPath))
	{

		foreach (DataRow dr in dtInput.Rows)
		{
			adapterUD100.BOConnect();

			string donorNum = dr["Donor"].ToString();
			string whereClause = string.Format("Key1 like '{0}-%'", donorNum);	
			//MessageBox.Show(whereClause);				
		//find related UD100 records and update them on substring(Key1,0,7) = DonorNum and update UD100.Character04 to OPOAgency and UD100.Character05 to OPODonorNum

			var dsBOReader = boReader.GetList("Ice:BO:UD100", whereClause, "");
			int rowCount = dsBOReader.Tables[0].Rows.Count;
			if(dsBOReader.Tables[0].Rows.Count>0)
			{
				//MessageBox.Show(dsUD100.Tables[0].Rows[rowCount-1]["Key2"].ToString());
				//build out data structure for UD100 mass update
				//foreach
				{
					rowCount++;
				}
			}
			//update here

			adapterUD100.Dispose();
		}
	}
1 Like

BOReader calls the BO’s GetList Method, which returns a ListDataSet that only includes the parent table.
In the context of SalesOrders, only the OrderHedListDataSet.
This is why you only have a single where clause because there is only one table to filter.

BOReader is great becuase you can specify the columns you want to return, to keep the return data small.

If you try to use BOReader on an object that does not have GeyByID defined, you get an exception regarding a failure to call the BO’s GetByID method.

4 Likes