public final class InventTableNameUpdateClass
{
InventTable inventTable;
str newNameAlias;
{
InventTable inventTable;
str newNameAlias;
public InventTable parmInventTable(InventTable _inventTable = inventTable)
{
inventTable = _inventTable;
return inventTable;
}
public static void main(Args _args)
{
InventTableNameUpdateClass NameUpdate = new InventTableNameUpdateClass();
NameUpdate.parmInventTable(_args.record());
NameUpdate.run();
}
boolean dialog()
{
Dialog d = new Dialog('NameAlias ');
DialogField dfNameAlias;
dfNameAlias = d.addField(extendedTypeStr(NameAlias), 'NameAlias:');
dfNameAlias.value(inventTable.NameAlias);
{
inventTable = _inventTable;
return inventTable;
}
public static void main(Args _args)
{
InventTableNameUpdateClass NameUpdate = new InventTableNameUpdateClass();
NameUpdate.parmInventTable(_args.record());
NameUpdate.run();
}
boolean dialog()
{
Dialog d = new Dialog('NameAlias ');
DialogField dfNameAlias;
dfNameAlias = d.addField(extendedTypeStr(NameAlias), 'NameAlias:');
dfNameAlias.value(inventTable.NameAlias);
if (d.run())
{
newNameAlias = dfNameAlias.value();
return true;
}
else
{
return false;
}
}
public void run()
{
if (this.dialog())
{
ttsBegin;
inventTable.selectForUpdate(true);
inventTable.NameAlias = newNameAlias;
inventTable.update();
ttsCommit;
info("succesfull .");
}
else
{
info("failed.");
}
}
}
else
{
info("failed.");
}
}
}
I have such a class. I can change the namealias value of the selected record with the dialog, but I want to change the namealias value of more than one selected record. Can you help me with the code?
Categories:
