I appreciate everyone's responses and with using pieces of code from all of you, I was able to find the simplest solution to get this working. Hopefully this post can help people in the future.
First add a list in your Contract class
class TCI_OutsideServicePackingSlipContract
{
List selectedRecs;
[
DataMember('selectedRecs'),
SysOperationLabelAttribute(literalStr("Recs")),
SysOperationHelpTextAttribute(literalStr("Recs")),
AifCollectionType('return', Types::String)
]
public List parmSelectedRecs(List _selectedRecs = selectedRecs)
{
selectedRecs = _selectedRecs;
return selectedRecs;
}
}
Next add some code to the Controller to loop through those records. Please note that the datasource table of the form I'm coming from is TCI_OutsideServiceImportLog
class TCI_OutsideServicePackingSlipController extends SrsReportRunController
{
public static void main(Args _args)
{
SrsReportRunController controller = new TCI_OutsideServicePackingSlipController();
controller.parmReportName(ssrsReportStr(TCI_OutsideServicePackingSlip, Report));
controller.parmArgs(_args);
controller.startOperation();
}
protected void prePromptModifyContract()
{
TCI_OutsideServicePackingSlipContract contract = this.parmReportContract().parmRdpContract();
TCI_OutsideServiceImportLog outsideServiceLog;
MultiSelectionHelper selection;
List selectedRecsFromController = new List(Types::Int64);
if (this.parmArgs().dataset() == tableNum(TCI_OutsideServiceImportLog))
{
selection = MultiSelectionHelper::createFromCaller(this.parmArgs().caller());
outsideServiceLog = selection.getFirst();
while (outsideServiceLog)
{
selectedRecsFromController.addEnd(outsideServiceLog.RecId);
outsideServiceLog = selection.getNext();
}
}
contract.parmSelectedRecs(selectedRecsFromController);
this.parmReportContract().parmReportName(ssrsReportStr(TCI_OutsideServicePackingSlip, Report));
boolean isPreview = false;
//Set the target print destination to screen
if (isPreview)
{
this.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::Screen);
}
this.parmshowDialog(!isPreview);
this.parmLoadFromSysLastValue(!isPreview);
}
}
Lastly, when you want to loop through the records in that list, you can do it this way. You won't have to do the _recordBuilder code unless you are doing a Docentric report like I am doing.
TCI_OutsideServicePackingSlipContract reportContract = this.getSrsRdpContract();
TCI_OutsideServiceImportLog outsideServiceImportLog;
InventTable inventTable;
List selectedRecsDSP;
ListEnumerator enumerator;
selectedRecsDSP = reportContract.parmSelectedRecs();
enumerator = selectedRecsDSP.getEnumerator();
enumerator.reset();
while(enumerator.moveNext())
{
select outsideServiceImportLog
where outsideServiceImportLog.RecId == enumerator.current()
join inventTable
where inventTable.ItemId == outsideServiceImportLog.ItemId;
if (outsideServiceImportLog)
{
_recordBuilder.addRecordWithAllFields(outsideServiceImportLog);
_recordBuilder.addRecordWithAllFields(inventTable);
_recordBuilder.goToTopRecord();
}
}
And that's it! Hopefully someone finds this helpful