Dhanalakshmi
(Dhanalakshmi Sabapathi)
June 21, 2019, 10:30am
1
Hello Epicor,
We are upgrading our epicor fr0m 10.1.4.2 to 10.2.3.17 tomorrow.
And we get the following error in two of our bpm …can you please help us in fixing this…
System.Drawing.Bitmap CS1061 ‘CallContext’ does not contain a definition for ‘GetMainContext’ and no extension method ‘GetMainContext’ accepting a first argument of type ‘CallContext’ could be found (are you missing a using directive or an assembly reference?)
josecgomez
(Jose C Gomez)
June 21, 2019, 10:32am
2
DB is already available on all custom code on BPM not sure why you are trying to recreate it.
Just use this.Db
Dhanalakshmi
(Dhanalakshmi Sabapathi)
June 21, 2019, 10:45am
3
Thanks for the quick response, can you please confirm that the changes I have done to the code is right…
This is the original bpm
var db = CallContext.Current.GetMainContext(); //Commented this
var rst_ttTask = ttTask.Where(i => i.RowMod == “U”).FirstOrDefault();
if (rst_ttTask != null)
{
if (rst_ttTask.Complete == true)
{
var rst_TaskSNxt = db.TaskSNxt.Where(i => i.TaskSetID == rst_ttTask.TaskSetID && i.TaskSetSeq == rst_ttTask.TaskSetSeq && i.DefaultNext == true).FirstOrDefault();
if (rst_TaskSNxt !=null)
{
rst_ttTask.NextTaskSeq = rst_TaskSNxt.NextTaskSeq;
}
//this.PublishInfoMessage(messageText, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, boName, methodName);
}
else
{
rst_ttTask.NextTaskSeq = 0;
}
}
This is what I changed as per your suggestion…and am not getting that error …just wanted to confirm whether this is correct
//var db = CallContext.Current.GetMainContext();
var rst_ttTask = ttTask.Where(i => i.RowMod == “U”).FirstOrDefault();
if (rst_ttTask != null)
{
if (rst_ttTask.Complete == true)
{
var rst_TaskSNxt = Db.TaskSNxt.Where(i => i.TaskSetID == rst_ttTask.TaskSetID && i.TaskSetSeq == rst_ttTask.TaskSetSeq && i.DefaultNext == true).FirstOrDefault();
if (rst_TaskSNxt !=null)
{
rst_ttTask.NextTaskSeq = rst_TaskSNxt.NextTaskSeq;
}
}
else
{
rst_ttTask.NextTaskSeq = 0;
}
}
Hi,
You can open method or data directives and click advanced programming or generate new template to to see what new is there is 10.2
Thanks