I have contacted Epicor support about this and they were not super helpful… I have installed remote debugging on one of our application servers (visual studio community 2015) to attempt to debug a BPM that has been a with us during our upgrade from 10.1.400.31 to 10.2.200.11. I have searched this and attempted to connect but not able to get it. We have no plans at this time to develop using visual studios but I do need it to debug… Any help would be appreciated.
Debugging a BPM with visual studio is not for the faint of heart. It is a giant nightmare and usually not worth the hassle. I recommend instead that you try and get us (or someone) to get help you with your BPM.
What is the issue you are having?
We have a foreach inside another for each and the running total value isn’t clearing on the change of a part. I would still like to get the debugging working, I been working with visual studios since .net 1.1 and epicor for about 8 years now. I believe it would help me personally
Perhaps post the code and it might be obvious
foreach (var ttOrderDtl_xRow in ttOrderDtl)
{
var od = ttOrderDtl_xRow;
//loop through each partwhse record for the part being ordered to calculate demand and on hand qtys
foreach (var pw in (from PartWhse_Row in Db.PartWhse
where (string.Compare(PartWhse_Row.Company, od.Company, true)==0 &&
string.Compare(PartWhse_Row.PartNum, od.PartNum, true)==0)
select PartWhse_Row))
{
//calc total demand and onhand for all partwhse rows
totaldemand = pw.DemandQty + totaldemand;
totalonhand = pw.OnHandQty + totalonhand;
//count partwhse rows found
pwcount = pwcount + 1;
}
//only run if partwhse record found to exclude potf's
if (pwcount > 0)
{
//exclude this line qty from calculation as epicor states they do in field notes
if (totaldemand != 0)
{
totaldemand = totaldemand - od.OrderQty;
}
//calc total available qty
totalavail = totalonhand - totaldemand;
//enable message below to troubleshoot all calculations
//this.PublishInfoMessage("Total on hand: " + Convert.ToString(totalonhand) + "\rTotal demand: " + Convert.ToString(totaldemand) + "\r\rAvailable: " + Convert.ToString(totalavail) + "\rThis line: " + Convert.ToString(od.OrderQty), Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
if (totalavail < od.OrderQty)
{
this.PublishInfoMessage("Order is for greater quantity than is currently available. Please review. \r\rAvailable: " + Convert.ToString(Math.Round(totalavail, 2)) + "\rThis Line: " + Convert.ToString(Math.Round(od.OrderQty, 2)) + "\r\rEpicor BPM\rMethod SalesOrder.Update Pre and Post\rSeq 10", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
}
}
}
Here is documentation on how to do it
https://scrs.epicor.com/ABLConversionweb/About.aspx
(Log in with your EpicWeb Credentials)
However be warned that IF you get it work, by debugging BPMs you are breaking (that is step debugging the AppServer) so all functions in Epicor seases to work until you have finished debugging. You are literally putting a break in the Epicor App Server process.
So thread lightly.
@rbucek and I went down this road a few years ago and as far as I know we both came out the other side saying… Thanks but no thanks!
haha…the hours wasted and the headaches gained! It would work like magic for a few weeks and then inexplicably break and you swore you changed nothing! Simple windows security updates or a slight breeze would take it down. Sometimes it would kinda work but not break or resolve local variables which, makes it less than useless (especially for what you are trying to do). It is useful in my opinion for development in syntax and error checking and source code storage if you find value in that. The only semi-reliable debugging I’ve seen is for UI customization’s and even then it’s super picky on the version and you have to (cough cough) hack around their VS version control in the helper dll to use anything remotely recent. However if you do down that road make sure you debug in production for a good laugh. Kidding…
What variable are you concerned about? totalavial?
well maybe after reading the documentation I might stay away from that… Since i know Epicor is super picky
total demand is the problem, I can change the code so it will do the part change right but then the totaldemand is off for the repeated part.
where is totaldemand being initalized and reset?
Is this on a method where you can create some pop up messages? It’s a handy (if not a little tedious) way to see the values.
Just a thought.
on the top of page
int pwcount = 0;
decimal totaldemand = 0;
decimal totalonhand = 0;
decimal totalavail = 0;
Erp.Tables.PartWhse PartWhse;
if (totalavail < od.OrderQty)
{
this.PublishInfoMessage("Order is for greater quantity than is currently available. Please review. \r\rAvailable: " + Convert.ToString(Math.Round(totalavail, 2)) + "\rThis Line: " + Convert.ToString(Math.Round(od.OrderQty, 2)) + "\r\rEpicor BPM\rMethod SalesOrder.Update Pre and Post\rSeq 10", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
}
the end of the code
ok sowhat is the issue you are running into? Is your totalDemand not changing when you change Orders?
not changing from part to part in the order
You are looping through ttOrderDtl which generally only contains the “current” OrderDtl record. Which method is this running on?
this is a post-processing method on sales order.update
Can you give an example of some values you’d know and outputs you’d expect vs. what you’re getting?