Wednesday, 13 January 2021

Controller class show dialog no

class IEDeliveryDateReportController extends SrsReportRunController

{

protected void PrePromptModifyContract()

{

    this.parmShowDialog(false);

    this.setRange(this.parmReportContract().parmQueryContracts().lookup(this.getFirstQueryContractKey()));

}


public void setRange(Query   _query)

{

    RecId                       inventJournalTableRecId,inventJournalTransRecId;

    InventJournalTable          inventJournalTable;

    InventJournalTrans          inventJournalTrans;


    if(this.parmArgs())

    {

        if( (this.parmArgs().record().TableId) == tableNum(InventJournalTable))

        {

            inventJournalTable      = this.parmArgs().record() as InventJournalTable;


            inventJournalTableRecId = inventJournalTable.RecId;

        }


        if( (this.parmArgs().record().TableId) == tableNum(InventJournalTrans))

        {

            inventJournalTrans      = this.parmArgs().record() as InventJournalTrans;


            inventJournalTableRecId = inventJournalTrans.RecId;

        }

    }

    if (inventJournalTableRecId)

    {

        SysQuery::findOrCreateRange(_query.dataSourceTable(tableNum(InventJournalTable)),fieldNum(InventJournalTable, RecId)).value(SysQuery::value(inventJournalTableRecId));

    }


     if (inventJournalTransRecId)

    {

        SysQuery::findOrCreateRange(_query.dataSourceTable(tableNum(InventJournalTrans)),fieldNum(InventJournalTrans, RecId)).value(SysQuery::value(inventJournalTransRecId));

    }

}

public static void main(Args _args)
{
    InventJournalTable          inventJournalTable1;
    InventJournalName           InventJournalName;
    IEDeliveryDateReportController    controller = new IEDeliveryDateReportController();

    inventJournalTable1      = _args.record() as InventJournalTable;

    select InventJournalName where InventJournalName.JournalNameId == inventJournalTable1.JournalNameId
                              &&   InventJournalName.JournalType == InventJournalType::Movement;

    if(InventJournalName.RecId  && curext() == "")
    {
       controller.parmReportName(ssrsReportStr(report1, Report));
    }
  
    else
    {
        controller.parmReportName(ssrsReportStr(report2, Report));
    }

    controller.parmArgs(_args);

    controller.startOperation();
}





No comments:

Post a Comment