Converting from E9 ABL Code getUDTableFieldLogical

I’m trying to convert ABL code and have come across this snippet of code which includes getUDTableFieldLogical, does anyone know what this does or where there might be any information as I’ve drawn a complete blank.

FIND FIRST ttpart WHERE (ttpart.rowmod = “A” OR ttpart.rowmod = “U”) NO-LOCK NO-ERROR.
IF AVAIL ttpart THEN DO:

 if ttCallContextBPMData.checkBox01 = ? or ttCallContextBPMData.checkBox01 = false then do:
      if getUDTableFieldLogical('ttPart','SpecReqPP',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkPP',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqProdn',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkProdn',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqInks',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkInks',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqPerf',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkPerf',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqBook',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkBook',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqWASP',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkWASP',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqNumber',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkNumber',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqHolo',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkHolo',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqPack',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkPack',ttPart.SysRowID) = false then ChecksDone = false.
      if getUDTableFieldLogical('ttPart','SpecReqTran',ttPart.SysRowID) = true and getUDTableFieldLogical('ttPart','SpecChkTran',ttPart.SysRowID) = false then ChecksDone = false.
      if not(ChecksDone) then {lib/PublishInfoMsg.i &InfoMsg = '"WARNING-you have not accessed & checked all of the sheets marked as required"'}.
 end.

That looks like a function. I would guess those fields are in a UDxx with those fields as keys? If the row is found it returns true and if not false. I would use a search all tables sql query to find the table.

Try just referencing the UD fields like ttPart.SpecReqPP_c

Thanks for the help, I’ve tried this:

if ((bool)ttPartRow["SpecReqPP"] == true && (bool)ttPartRow["SpecChkPP"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqProdn"] == true && (bool)ttPartRow["SpecChkProdn"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqInks"] == true && (bool)ttPartRow["SpecChkInks"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqPerf"] == true && (bool)ttPartRow["SpecChkPerf"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqBook"] == true && (bool)ttPartRow["SpecChkBook"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqWASP"] == true && (bool)ttPartRow["SpecChkWASP"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqNumber"] == true && (bool)ttPartRow["SpecChkNumber"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqHolo"] == true && (bool)ttPartRow["SpecChkHolo"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqPack"] == true && (bool)ttPartRow["SpecChkPack"] == false)
{
  ChecksDone = false;
}

if ((bool)ttPartRow["SpecReqTran"] == true && (bool)ttPartRow["SpecChkTran"] == false)
{
  ChecksDone = false;
}

if (!(ChecksDone))
{

  CallContext.Current.ExceptionManager.AddBLException("WARNING-you have not accessed & checked all of the sheets marked as required");
  THROW_PRIVATE = null;
  return;
}

But it gives a few errors first up being:

Application Error

Exception caught in: System.Data

Error Detail

Message: Collection was modified; enumeration operation might not execute.
Program: System.Data.dll
Method: MoveNext

Client Stack Trace

at System.Data.RBTree1.RBTreeEnumerator.MoveNext() at System.Linq.Enumerable.<CastIterator>d__971.MoveNext()
at Ice.Lib.CallContextHandler.InfoMessageHandler.Handle(ContextDataSet contextData)

Oh well onwards and upwards I hope

probably not the issue , but …

maybe you didn’t include it in your copied code, but you should set ChecksDone = true; prior to the first if() statement.

EDIT

Also, if SpecReqPack is a UD field of the Part table, you might need to refer to it as SpecReqPack_c. Emphasis on “might”, as I’m not sure of the details of using LINQ on UD fields via extended tables.

One more thing…

There was a bug related to the format used when referencing UD fields

The ICE Guide says to use:

  • for Meth Dir: ttOrderHed.UDField<System.String>("MyNewColumn_c")
  • for Data Dir: ttOrderHed.MyNewColumn_c

But I ended up having to use:
ttOrderHedRow.UDField<System.String>("MyNewColumn")
in my Data Directive.

Try a syntax like
ttPartRow.UDField<System.Boolean>("SpecReqProdn") == true

Tanks for your tips ckrusen I’ve tried them all but sadly the error’s are still with me I’ll keep plugging away. Sorry your last method solved the problem I’d added a message incorrectly that stopped your solution working.

Thanks for your help