Add Fields to Epicor Custom Grid

This should not be the case.

He was not having a reference location problem - but more an issue of not having the right references. The client handles bringing in the assemblies from the proper location, unless you choose to go browse elsewhere which will not work. The path, once added, is smart enough to show whether it initially came from an E:\EpicorClient or now needs C:\EpicorClient

1 Like

Many Many Thanks @danbedwards
your code is working great, it slow the UI abit but this is acceptable compare to what we achieved, now i can use this ‘superduper’ code method technique to Add, link, and display any value on the Database to any Epicor Custom Tracker, really appreciate your support.

@ckrusen,
Thanks for your note, but @danbedwards already helped me to find these assy DLL files.

1 Like

Hi Dan,
i hope that you are ok, i am trying to apply this code to add a field (OrderRel.NeedByDate) to the Demand Custom Grid in Job Manager, the new issue in this case is passing three parameters not one i.e. OrderNum, OrderLine, and OrderRel, also could you please shed some light on GetByID LINQ structure here, as i menstioned before i have started teach myself C# in the past 6 months, and i am doing OK so far, so if you or any one on this great Forum know useful websites/documents/training material describing using Database C#.Net commands, i will be very appreciated to your advice,

Hi all
@hkeric.wci,
could any one help on this code issue ???
i am trying to apply this code to add a field (OrderRel.NeedByDate) to the Demand Custom Grid in Job Manager, the new issue in this case is passing three parameters not one i.e. OrderNum, OrderLine, and OrderRel, also could you please shed some light on GetByID LINQ structure here, as i menstioned before i have started teach myself C# in the past 6 months, and i am doing OK so far, so if you or any one on this great Forum know useful websites/documents/training material describing using Database C#.Net commands, i will be very appreciated to your advice,

I tried this code and it is giving me a null reference exception. Help.

it is an old post Chris, this issue has been resolved in many ways, check this post mate

OK, not getting the exception anymore but i can’t get this code to work
if (!string.IsNullOrEmpty(resource))
{
DataSet ds = _boReader.GetRows(“Erp:BO:Resource”, “ResourceID=’” + resource + “’”, “Description”);
if(ds.Tables[0].Rows.Count > 0)
{
row.Cells[“ResouceDesc”].Value = ds.Tables[0].Rows[0][“Description”];
}

I am trying to do this on the work queue.

Got this to work. It helps a lot if I spell thing correctly.

i prefer to use a dynamic query over BoReader, it is faster and easier, plenty of examples on the forum, this is one

1 Like

I use Dynamic Query when I need special data or when there exists possibility that a BSA will ask for different filtering.

I prefix the BAQs I use in Code with CODE-MyBAQIntent like CODE-GetLateAPInvoices.

I use BO Reader when its a flat file such as just get me a field from Customer, UDCode, Company Setting… Less dependencies.

2 Likes

many thanks @hkeric.wci
BO Reader (Get Rows) is very slow in the example i tried and posted, may be i need to optimise my code a bit

The nice thing about BOReader is that you can specify in the third arg/param what columns you want returned which in theory should speed it up :thinking:

Hi @tkoch
could you share a full example here please, mine on this thread was selected for one column as a parameter and was very slow compared to the Dynamic query

I was just indicating that in theory since you are specifying a smaller dataset to return boreader should be good to use, though I have not compared it returning the same data vs dynamic query. I have used boreader in a lot of places and haven’t observed any noticeable performance losses. I’ll run a test since I’m now curious

1 Like

I am seeing BOReader is about 4-5 times faster with this test

                Stopwatch stopWatch = new Stopwatch();

                stopWatch.Start();
                DynamicQueryImpl qry = WCFServiceSupport.CreateImpl<DynamicQueryImpl>(epiSession, DynamicQueryImpl.UriPath);
                DynamicQueryDataSet qDs = qry.GetByID("boreadertest");
                QueryExecutionDataSet qed = new QueryExecutionDataSet();

                qDs.QueryWhereItem[0].RValue = "419";

                qDs.AcceptChanges();

                var baqRes = qry.Execute(qDs, qed);
                stopWatch.Stop();
                Debug.WriteLine("DYNAMIC QUERY: " + stopWatch.ElapsedMilliseconds.ToString() + "ms");

                stopWatch.Reset();

                stopWatch.Start();
                BOReaderImpl boReader = WCFServiceSupport.CreateImpl<BOReaderImpl>(epiSession, BOReaderImpl.UriPath);
                string whereClause = "ResourceID='419'";
                DataSet ds = boReader.GetList("Erp:BO:Resource", whereClause, "Description");
                stopWatch.Stop();
                Debug.WriteLine("BOREADER: " + stopWatch.ElapsedMilliseconds.ToString() + "ms"); 
1 Like

you are using GetList, would GetRows to grid could make a different ?

Good call, let me try that

Still similar results

then based on this, the second step which is inserting back the data to existed grid row by row is the bottleneck as DQ will display the whole data in one hit !! am i right ?

Yes, I think it is slow because it runs for each row in the grid. I have done in the past if I know I need data like this I just pull all the data in one call to a dataset (just query for Resource table on form load) then on row initialize find the relevant data in the dataset rather than running a query for each row

1 Like