The best way to pass records to a class

This is the best method to pass the selected records from a Form to a Class

static void Main(Args args)
{
    MultiSelectionHelper    multiSelectionHelper;
    AssetTable              AssetTable;
    ;

    multiSelectionHelper = MultiSelectionHelper::createFromCaller(args.caller());
    assetTable  = multiSelectionHelper.getFirst();
    while (assetTable)
    {
        info(assetTable.AssetId);
        assetTable = multiSelectionHelper.getNext();
    }
}

MultiSelectionHelper class helps to iterate into selected records.
If you are using args object on your target class consider to use the method:

multiSelectionHelper.parmCacheRecords(true);

Leave a Reply