One thing that has been really bugging me when trying to diagnose issues with some BPMs is the way Epicor doesn’t display all rows in tables when using their Show Message widget with Table Query.
When there is a row that has no RowMod as well as the same SysRowID but RowMod of ‘U’, it only shows the ‘U’ one. This means that, if you want to see the changed from, then you have to write code to list the data.
To me, this seems like a bug, but it’s obviously been intentionally coded this way. What do others feel about this and is it worth creating a suggestion for it (possibly a checkbox for ‘Include previous value rows’), or am I the only one who thinks this is a frustration?
I’ve written my own code that I can just plop in to get what I want, but it that it’s not possible with the widget.
var dsTable = ds.LaborDtl;
bool IncludeCustomColumns = true;
bool IncludeHeader = true;
bool IncludeHeaderSeperator = false;
bool IncludeTypeRow = false;var messageTextBuilder = new System.Text.StringBuilder();
//Create the HEADER
if (IncludeHeader)
{
foreach ( var rowColumn in dsTable.Columns)
{
messageTextBuilder.Append(rowColumn.ColumnName).Append(“,”);
}
if (dsTable.HasExtendedColumns)
{
foreach ( var rowColumn in dsTable.ExtendedColumns.Where(r=> r.ColumnName != “UD_SysRevID”))
{
messageTextBuilder.Append(rowColumn.ColumnName).Append(“,”);
}
}
if(messageTextBuilder.Length > 0) messageTextBuilder.Length = messageTextBuilder.Length - 1;
messageTextBuilder.AppendLine();
}
if (IncludeHeaderSeperator)
{
messageTextBuilder.Append(‘-’, messageTextBuilder.Length - 1);
messageTextBuilder.AppendLine();
}//First Row Is TYPE
if (IncludeTypeRow)
{
foreach ( var rowColumn in dsTable.Columns)
{
messageTextBuilder.Append(rowColumn.DataType.Name).Append(“,”);
}
if (dsTable.HasExtendedColumns)
{
foreach ( var rowColumn in dsTable.ExtendedColumns.Where(r=> r.ColumnName != “UD_SysRevID”))
{
messageTextBuilder.Append(rowColumn.ColumnType.Name).Append(“,”);
}
}
if(messageTextBuilder.Length > 0) messageTextBuilder.Length = messageTextBuilder.Length - 1;
messageTextBuilder.AppendLine();
}//List the CONTENTS
foreach ( var TableContentsRow in ds.LaborDtl)
{
foreach ( var rowColumn in dsTable.Columns)
{
switch (rowColumn.DataType.Name)
{
case “string” :
messageTextBuilder.Append(TableContentsRow[rowColumn.ColumnName] ?? “”);
break;
default :
messageTextBuilder.Append(TableContentsRow[rowColumn.ColumnName]!=null ? TableContentsRow[rowColumn.ColumnName].ToString() : “”);
break;
}
messageTextBuilder.Append(“,”);
}
if (dsTable.HasExtendedColumns)
{
foreach ( var rowColumn in dsTable.ExtendedColumns.Where(r=> r.ColumnName != “UD_SysRevID”))
{
switch (rowColumn.ColumnType.Name)
{
case “string” :
messageTextBuilder.Append(TableContentsRow[rowColumn.ColumnName] ?? “”);
break;
case “Byte” :
//messageTextBuilder.Append(TableContentsRow[rowColumn.ColumnName] ?? “”);
break;
default :
messageTextBuilder.Append(TableContentsRow[rowColumn.ColumnName]!=null ? TableContentsRow[rowColumn.ColumnName].ToString() : “”);
break;
}
messageTextBuilder.Append(“,”);
}
}
if(messageTextBuilder.Length > 0) messageTextBuilder.Length = messageTextBuilder.Length - 1;
messageTextBuilder.AppendLine();
}var messageText = messageTextBuilder.ToString();
this.PublishInfoMessage(messageText, 0, 0, “”, “”);