How to pass
values from form to report
Hi Folks,
Follow below steps to understand this,
1. Make the report as Interactive
2. Create Method initFromCaller and pass the args to it.
3. Set the report caption (it will appear in dialog).
4. The Method initFromCaller.
Method initFromCaller Basicllt this form will call whenever
you call this menu item from FORM.
public void initFromCaller(Args _args)
{
InventJournalTable inventJournalTable;
QueryBuildDataSource qbds;
;
if (_args.caller())
{
if (! _args.record().recId)
throw
error(strfmt("@SYS22338",funcname()));
switch (_args.dataset())
{
case tablenum(InventJournalTable):
inventJournalTable = _args.record();
if (inventJournalTable.journalType != InventJournalType::Transfer)
throw error(strfmt("@SYS23396",funcname()));
break;
default:
throw error(strfmt("@SYS23396",funcname()));
}
}
if (true || inventJournalTable.journalId)
{
qbds = element.query().dataSourceTable(tablenum(InventJournalTrans));
SysQuery::findOrCreateRange(qbds, fieldnum(InventJournalTrans,
journalId)).value(inventJournalTable.journalId);
SysQuery::findOrCreateRange(qbds, fieldnum(InventJournalTrans,
journalType)).value(queryValue(InventJournalType::Transfer));
}
}
Enjoy Guys......
-Harry
Thank you!!
ReplyDeleteYour welcome Ivan. Keep sharing your feedback.
ReplyDelete