uBAQ BPM - Custom Code Help

Hey there,

I am trying to reverse engineer a BPM as a learning exercise and I am having a little trouble.

I am trying to re-work an uBAQ+Post Processing Directive and Dashboard it so it sets all order releases (orderrel.firmrelease) to True when an order is taken off hold (orderhed.orderheld = False) from an updateable DB.

I am having trouble wrapping my head around how the data/table set is created, pulled in and updated. I also don’t know why I am getting the ttresult error, it’s strange, in the bpm queries there are no ttresults to work with either, just DataSets (ds.) Maybe something to do with newer versions of E10/Kinetic.

I am pasting what I worked through below to see if you can give me some guidance… most will probably be able to tell what i was trying to do from the example…

Anyway, let me know if anyone has any thoughts or guidance.

var results = ttResults.FirstOrDefault();

bool orderHold = results.OrderHed_OnHold;
int orderNum = Convert.ToInt32(results.OrderRel_OrderNum);
int orderLine = Convert.ToInt32(results.OrderRel_LineNum);
int orderRel = Convert.ToInt32(results.OrderRel_ReleaseNum);

if (orderHold == false)
    var orderSVC = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrderSvcContract>(this.Db);
    using (orderSVC)
        Erp.Tablesets.SalesOrderTableset SOTS = orderSVC.GetByID(orderNum);
        var relToFirm = SOTS.OrderRel.Where(od => (od.OrderLine == orderLine) && (od.OrderRel == orderRel)).FirstOrDefault();
        relToFirm.FirmRelease = true;
        relToFirm.RowMod = "U";
        orderSVC.Update(ref SOTS);

In Kinetic ttResult is gone and was replaced with a dataset. (ds)

1 Like

Thanks for confirming Jose, and thanks for always having patience for dumb operations guys like me, clumsily barreling through customizations like a bull in a china shop.

So bringing in the results should look something like this now…
var results = queryResultDataset.Results;

I can relate LOL :joy:
This forum is the best ever!