Bartender BPM Obsolete Custom Code

In the latest kinetic 2025.2.14, I have three BPMs that have some obsolete code in them that someone from Epicor wrote about 2 years ago now. In the BPM studio, a warning pops up upon saving that says that there will be errors in the future. I was also told that these should be changed to have the correct sandbox methods.

The warnings appear on:
ShipDtlLabel.txt (7.4 KB): line 170
ShipHead_PalletLabel_v1.txt (4.7 KB): line 150
ShipHead_PrintAllLineLbls.txt (8.8 KB): line 139

The file paths and printers are User Codes. The file paths point to our azure file share, and the printers point to shared printers on our server.

These are just the warnings that pop up, but I am also wondering if there is anything else that could pop up in the future with this code.

What will I have to do to change these to the correct format?

I’m not looking at all that lol, but I’ll show you mine…

Lockeandkey GIF by NETFLIX

var sb = (ISandbox)Sandbox; //Makes autocomplete behave

string dt = DateTime.Now.ToString("yyyy_MM_dd-HH_mm_ss_fff");

//My ServerFolder.FileShare is mapped to the Azure File Share by Epicor
var fp = new FilePath(ServerFolder.FileShare, $@"Bartender/{labelType}{jobNum}{pcid}{lotNum}{pseudoLot}{dt}.json");

sb.IO.File.WriteAllText(fp, labelBuffer);

3 Likes

ooo json drops, frisky. i fancy btxml myself!

1 Like

Alright it looks like this worked perfectly. All I did was add the following:

fileName = (btPath + "CartonLabel_" + DateTime.Now.ToString("yyyyMMddHHmmssffff")) + @".bt";
var fp = new FilePath(ServerFolder.FileShare, fileName); //Sets file path
    sb.IO.File.WriteAllText(fp, sOut);

Oh I also had to change the btPath UD code to be ā€œBartender/Data/ā€. Thanks for your help!

2 Likes