Convert ABL Code to C# - Kinetic Cloud

Hi All, we’re working on upgrading from E9 to Kinetic Cloud. Working through customizations and BPMs and BAQs. We’re working on consolidating/improving code wherever possible. One area we have heavily customized is PO entry and we have a special dashboard created which allows buyers to update specific UD fields on POs. Mainly checkboxes and some info on the header. We have this all built into an updateable dashboard so that users don’t have to unapprove and re-approve POs. I’m struggling to reproduce this functionality in Kinetic and I’m not sure if it’s b/c I’m on the could or b/c I haven’t figured out all the intricacies of C# sharp. Here’s the code from the UBAQ BPM I currently use. Any thoughts/ideas would be appreciated. Thanks in Advance!

For each ttresults no-lock where ttresults.RowMod <> ‘’, each poheader where poheader.Company = cur-comp and poheader.PONum = ttresults.POHeader_PONum.

if ttresults.POHeader_Checkbox10 = true and poheader.checkbox10 = false then
	assign POHeader.Date04 = today 
				ttresults.POHeader_Date04 = today.

if ttresults.POHeader_Checkbox12 = true and poheader.checkbox12 = false then
	assign POHeader.Date05 = today 
				ttresults.POHeader_Date05 = today.

if ttresults.POHeader_Checkbox09 = true and poheader.checkbox09 = false then
	assign POHeader.Date06 = today 
				ttresults.POHeader_Date06 = today.

if ttresults.POHeader_Confirmed = true and poheader.Confirmed = false then
	assign POHeader.Date07 = today 
				ttresults.POHeader_Date07 = today.

if ttresults.POHeader_Checkbox01 = true and poheader.CheckBox01 = false then
	assign POHeader.Date08 = today 
				ttresults.POHeader_Date08 = today.

if ttresults.POHeader_Checkbox13 = true and poheader.checkbox13 = false then
	assign POHeader.Date09 = today 
				ttresults.POHeader_Date09 = today.

if ttresults.POHeader_OrderHeld = true and poheader.OrderHeld = false then
	assign POHeader.Date10 = today 
				ttresults.POHeader_Date10 = today.

Assign poheader.CheckBox01 = ttresults.POHeader_CheckBox01
			poheader.CheckBox09 = ttresults.POHeader_CheckBox09
			poheader.CheckBox10 = ttresults.POHeader_CheckBox10
			poheader.CheckBox11 = ttresults.POHeader_CheckBox11
			poheader.CheckBox12 = ttresults.POHeader_CheckBox12
			poheader.checkbox13 = ttresults.POHeader_CheckBox13
			poheader.OrderHeld = ttresults.POHeader_OrderHeld
			poheader.Confirmed = ttresults.POHeader_Confirmed 
			poheader.Date04 = ttresults.POHeader_Date04
			poheader.Date05 = ttresults.POHeader_Date05
			poheader.Date06 = ttresults.POHeader_Date06
			poheader.Date07 = ttresults.POHeader_Date07
			poheader.Date08 = ttresults.POHeader_Date08
			poheader.Date09 = ttresults.POHeader_Date09
			poheader.Date10 = ttresults.POHeader_Date10.
			poheader.Character05 = ttresults.POHeader_Character05.

end.

For now…
I remember this guide for E10 was helpful, not sure if there is a newer version: Epicor ERP C# Programming Guide (conversion from ABL) 10.2.100

Also, Epicor used to have a site where you could convert old ABL.
Been a long time since I used it, think it was mostly OK, with a few quirks.

Otherwise… wonder if you can give more details on your dashboard?
Maybe even a screenshot?
I had an initial idea from your description
then I looked at your code… it just brought other questions to mind.
Not that the ABL code doesn’t make sense, just got me wondering if I’d be doing things differently now?

Post where you got so far with the C# and we’ll help patch it up.

@balmon As luck would have it I was adding a field to UBAQ that had gone thru the converter and still had the ABL. It is not pretty code, but will give you an idea of what the routine did. This code actually went 9 - 10 then 11 mostly untouched.

ABL to C# converted.txt (5.7 KB)

1 Like

@gpayne thanks for the help! Got a simplified version of this working with the below code. I should be able to take it from here. Also just fyi it does allow you to update without unapproving/reapproving the PO, which is very helpful for the dashboard I use this in!


foreach (var ttResultsRow in queryResultDataset.Results.Where(ttResults_Row => !ttResults_Row.Unchanged()))
{
  POHeader = Db.POHeader.Where(POHeader_Row=> POHeader_Row.Company == Session.CompanyID && POHeader_Row.SysRowID == ttResultsRow.POHeader_SysRowID).FirstOrDefault();
  
    if (POHeader != null)
    {
    
       POHeader.CheckBox01 = ttResultsRow.POHeader_CheckBox01;       
         
    }
    
}
2 Likes