Configurator broke after 10.2.300 > 10.2.500 upgrade - Compile Error

We’re testing our product configuration after upgrading out test environment from 10.2.300.12 to 10.2.500.8, and I received a compile error in Quote Entry. I’m no programmer, but did take @timshuwy’s Configurator course at Insights.

I started following this error down the rabbit hole:

  • Opened 'SHADE’in Configurator Designer > Actions > Test Inputs, and got the same error
  • I see the same error when I open the event expression in the On Save tab editor, and check syntax.
Description: There is at least one compilation error.
Details: 
_SHADEServerEvents.cs(57,69): error CS7036: There is no argument given that corresponds to the required formal parameter 'dataContext' of 'ServiceRenderer.GetService<TContract>(IceDataContext, bool)'
_SHADEServerEvents.cs(72,69): error CS7036: There is no argument given that corresponds to the required formal parameter 'dataContext' of 'ServiceRenderer.GetService<TContract>(IceDataContext, bool)'
                Program: Epicor.Customization.Core.dll
                Method: Compile
                Line Number: 78
                Column Number: 13

This family of configurators was created a few years ago, before my time. What does that error message mean, and how do I fix it? Did something change between 10.2.300 and 10.2.500 for these two lines?

using (var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrderSvcContract>())

What’s odd is that the error calls out Line 78, but looking at the code in Notepadd++, it only has 52 lines, and those two ‘using’ lines are 17 and 32.

Thanks for any help!

         // re-enable BPM methods 
            string entityName = OnSaveArgs.TargetEntity.EntitySetName;
            string partNum = (string) OnSaveArgs.TargetEntity["PartNum"];
            var partWeight = (from row in Db.Part
                              where row.Company == "ESAPCO" &&
                              row.PartNum == partNum
                              select row.NetWeight).FirstOrDefault();

            decimal lineWeight = (decimal)OnSaveArgs.TargetEntity["LineWeight_c"];
            decimal newLineWeight = (partWeight * Inputs.epiPcNumericEditor3.Value) + (partWeight * Inputs.epiPcNumericEditor19.Value);

            if (newLineWeight != lineWeight)
            {
                if (entityName == "OrderDtl")
                {
                    using (var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrderSvcContract>())
                    {
                        var orderNum = (int)OnSaveArgs.TargetEntity["OrderNum"];
                        var orderLine = (int)OnSaveArgs.TargetEntity["OrderLine"];
                        var dataSet = svc.GetByID(orderNum);
                        var dbDtl = dataSet.OrderDtl.Find(l => l.OrderLine == orderLine);
                        dbDtl["LineWeight_c"] = newLineWeight;
                        dbDtl.RowMod = "U";
                        dataSet.OHOrderMsc.Clear();
                        dataSet.OrderMsc.Clear();
                        dataSet.OrderHed.Clear();
                        svc.Update(ref dataSet);
                    }
                } else if (entityName == "QuoteDtl")
                {
                    using (var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.QuoteSvcContract>())
                    {
                        var orderNum = (int)OnSaveArgs.TargetEntity["QuoteNum"];
                        var orderLine = (int)OnSaveArgs.TargetEntity["QuoteLine"];
                        var dataSet = svc.GetByID(orderNum);
                        //var dbDtl = dataSet.QuoteDtl.Find(l => l.QuoteLine == orderLine);

                        //dbDtl["LineWeight_c"] = newLineWeight;                       
                        //dbDtl.RowMod = "U";
                        dataSet.QuoteHed.FirstOrDefault().RowMod = "U";
                        dataSet.QuoteDtl.Clear();
                        dataSet.QuoteCoPart.Clear();
                        dataSet.QSalesRP.Clear();
                        dataSet.QuoteQty.Clear();
                        dataSet.QuoteHedMsc.Clear();
                        dataSet.QuoteMsc.Clear();
//                        dataSet.QuoteHed.Clear();
                        svc.Update(ref dataSet);
                    }
                }
}

I believe you want to go to the following location on your Epicor Server:

\\ERPServer\c$\inetpub\wwwroot\ERP102500\Server\BPM\Sources\PC\

In the PC folder you’ll see a folder with a name like: CONFIGURATOR_.Failed

Open the Folder with the latest version for the Configurator. Inside this Folder you’ll usually find an Errors File which will indicate the File (For example: _Configurator_RuleEngine.cs) and the Line and Location on the Line (Line 86, Position on Line 79) within the File where the problem is happening.

2 Likes

I was comparing the line:
var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.QuoteSvcContract>()

with the E10 Programming guide and the guide adds this.Db as a parameter of the contrac
var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.QuoteSvcContract>(this.Db)

I’m not sure it will help, but maybe if you add this.Db it will help.

@jeromy FTW! Thank you so much.

image

Hi Heather - Thanks for that tip! The Errors.log file re-stated the same message:

_SHADEServerEvents.cs(57,69): error CS7036: There is no argument given that corresponds to the required formal parameter 'dataContext' of 'ServiceRenderer.GetService<TContract>(IceDataContext, bool)'
_SHADEServerEvents.cs(72,69): error CS7036: There is no argument given that corresponds to the required formal parameter 'dataContext' of 'ServiceRenderer.GetService<TContract>(IceDataContext, bool)'

Glad to hear it!