X++:
static void Job139(Args _args)
{
Common cm;
InventTable it;
DictTable dictTable = new DictTable(tablenum(InventTable));
DictField dictField;
str buf;
xppCompiler compiler = new xppCompiler();
;
select it where it.ItemId like "1*";
dictField = dictTable.fieldObject(fieldnum(InventTable, itemId));
buf = strfmt("%1 getRecord()\n{\n%1 %1;\n;\n select %1 where %1.%2 == \"%3\";\n return %1;}",
dictTable.name(), dictField.name(), it.ItemId);
if (compiler.compile(buf))
{
cm = compiler.execute();
// или
// cm = runbuf(buf);
info(cm.(fieldnum(InventTable, itemId)) + "::" + cm.(fieldnum(InventTable, itemName)));
}
else
info(compiler.errorText());
}
Можно использовать функцию runbuf() или метод execute() класса xppCompiler