Hi,
So i have this method in a class. But I want to call this method by code from another place. My question is how can i call it from another place, how can i fill args with more than on record then calling it?
public void initFromArgs(Args args)
{
Table1 record;
Table2 table2;
List list1;
List list2;
list1 = new List(Types::Record);
datasource = FormDataUtil::getFormDataSource(args.record());
list2 = new List(Types::Record);
switch (args.dataset())
{
case tablenum(table1):
if(datasource)
{
for (record = datasource.getFirst(true) ? datasource.getFirst(true) : datasource.cursor(); record; record = datasource.getNext())
{
this.list1Add(record);
}
}
else
{
this.list1Add(args.record());
}
break;
case tablenum(table2):
Set includedRecIds = new Set(Types::Int64);
if(datasource)
{
for (table2 = datasource.getFirst(true) ? datasource.getFirst(true) : datasource.cursor(); table2; table2 = datasource.getNext())
{
if (includedRecIds.in(table2.RecId))
{
continue;
}
list2.addEnd(table2);
includedRecIds.add(table2.RecId);
this.init(table2, includedRecIds);
if (!this.list1Con(table2.Table1()))
{
this.list1Add(table2.Table1());
}
}
}
else
{
table2 = args.record();
includedRecIds.add(table2.RecId);
this.init(table2, includedRecIds);
this.list1Add(table2.Table1());
}
break;
}