.NET to BPM Workflow tools

We have a bunch of .NET customizations that came over from the upgrade team when we upgraded from E9 to E10. Many of the customizations are similar to this one and I’m looking for some direction on how to migrate this away from a hardcoded customization. Any guidance would be appreciated.

Erp.Tables.Customer Customer;
foreach (var ttShipTo_xRow in ttShipTo)
{
    var ttShipToRow = ttShipTo_xRow;
    ttShipToRow.TerrSelectFlag = "LOCK";
    foreach (var Customer_iterator in (from Customer_Row in Db.Customer
                                       where Customer_Row.Company == ttShipTo_xRow.Company && Customer_Row.CustNum == ttShipTo_xRow.CustNum
                                       select Customer_Row))
    {
        Customer = Customer_iterator;
        ttShipTo_xRow.PhoneNum = Customer.PhoneNum;
        ttShipTo_xRow.FaxNum = Customer.FaxNum;
    }
}

You’re looking for a solution to get away from hard coding a single variable? Or something else?

Well, in this example the custom code is merely setting a default PhoneNum and Fax number when a new ShipTo is created… we have a lot of basic code blocks like this and I’ve been encouraged to migrate these somewhat simple custom code blocks to widgets in the Workflow Designer, perhaps making future upgrades easier to test and validate.

Oh, yeah use the field setting widgets to set default fields. There’s no need to write a bunch of LINQ for something so trivial

Right. That’s what I’m trying to figure out. I need to get data from the Customer table before I can set the field… That’s where I’m stuck. (I thought ‘Set by Query’ would get me there, but I haven’t been able to make it work properly)

Oh I see, you are trying to set new ShipTo rec field values from Customer values but you’re saying that the Customer values are not easily available in the widgets during this method call?
What method/BO are you using? I’ll be able to take a better look and screenshots, etc.

Customer.GetNewShipTo / Post-Processing is where this current code runs

(I see a bunch of temp tables in this method, but the ttCustomer doesn’t seem to have data).

Got it!!




1 Like

Aaron,

On another BPM, we need to set defaults for about 10 fields. Is it best to just have 10 “Set Field” widgets on my workflow designer to do this? It looks a bit crazy, but gets the job done.

I would think you could use the table mapping widgets like you used above? I’ve never used that but it looks like the right tool for the job…
Otherwise 10 widgets to avoid LINQ, if that’s what you want :wink:

Thanks. In the above is querying another table. In this situation I’m just setting manual defaults…