I am trying to use string.split() in a BPM custom code block the syntax is fine but I might be missing something. I am setting a variable equal to ttsysrptlst.systasknum in a argument/variable set widget. I have log messages and it shows a result like 123456;123456;123456. I am capturing a report after printing and it is using APR so it creates 3 records. but in ttSysRptLst it appears they are concatenated on one row. I need the Systasknum to be able to get other data. The below code works in other scenarios but this one i keep getting a null reference error. Anyone have any idea what I am missing or a better way to do this.
string s = CurSysTaskNum;
//s.Replace(';','~'); //***tried replacing with a different character
string[] ss = s.Split(';');
if(ss != null && ss.Length > 0)
{
FirstCurSysTaskNum = ss[0]; // set second variable equal to the first result in the array
}
string s = null;
if (!string.IsNullOrEmpty(s))
{
//s.Replace(';','~'); //***tried replacing with a different character
string[] ss = s.Split(';');
if(ss != null && ss.Length > 0)
{
string a = ss[0]; // set second variable equal to the first result in the array
}
}
I checked the logs and it is empty. I was mistaking the query field in the log for this one.
Why would the log query be able to access ttSysRptLst but not set argument/variable with this expression.
ttSysRptLstRow.SysTaskNum.ToString()
How can I access ttSysRptLst right from the code block. I was always told you shouldn’t access the tt tables from code but I know it’s possible.
That’s exactly what I was referring to. I also never had a need to use the temp tables. I just can’t figure out why the variable isn’t setting to the field.
What I am trying to do is to run a report after an APR routing runs. I need two different reports at the same time. I have gotten everything working except the print report widget runs 3 times because APR puts three rows in the tt table. I am currently trying to use code to run the report but can’t pull the adapters into custom code widget in the data directive. Do you by chance know if this is possible. I am getting the missing assembly reference error but I have all the references to orderack.
Sorry for being vague I have a few projects running at the same time and jumping around.
The code below compiles but throughs an error on the server. I finally figured out how to get it to load the adapter but it throws the run time error below the code. I really just need to access the order Ack adapter. I have done this in customizations and method directives but this is a data directive which runs on the server.
The error is Ice.Common.EpicorServerException: BPM runtime caught an unexpected exception of ‘FileNotFoundException’ type. See more info in the Inner Exception section of Exception Details.
—> System.IO.FileNotFoundException: Could not load file or assembly ‘Erp.UIRpt.SalesOrderAck, Version=11.2.300.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992’. The system cannot find the file specified.* File name: ‘Erp.UIRpt.SalesOrderAck, Version=11.2.300.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992’
I figured as much but I have to either use code or accept that the pint widget will send 3 of the report I want. Do you know of another way? I was thinking a method directive but assumed I would get the same issue.