How we can add custom Lookup on Morphx Report Dialog Box?

Basically, my requirement is like these.   I have a Morphx repoprt when we open these report , a dialog box will open. Which have Four field 

a) From Date          b) To Date        c) Customer Group       d) Customer Account

Basically, i want when we select Customer Group (For ex. 10 ), so only customer which are under these customer group are shown in Customer Account Field........ Please remember i want these customization only on Morphx report. In SSRS Report  or Excel Report i achieved these customization.........................

  • In reply to Ganesh408:

    i seen your xpo but i cant understand how you can retrive parameter from form and how data is filtered basis on the given parameters............

    dialog = Dialog::newFormnameRunbase(formstr(B2B_IndentGenerationReportForm), sysReportRun.runbaseReport());

    form will be called but parameters which are passes on form dialog field how we can get it.......
  • In reply to MayurSaini:

    Try to understand that

    after then create these methods in form

    1. class declaration

    public class FormRun extends ObjectRun

    {

       Object          sysReportRun;

       RunBaseReport   runBaseReport;

    }

    2. init

    public void init()

    {

       ;

       runBaseReport = element.args().caller().runbase();

       sysReportRun = runBaseReport.reportRun();

    }

    3. create run base

    public RunBase runbase()

    {

       return element.args().caller().runbase();

    }

    4.  create closeok

    public void closeOk()

    {

       ;

       if (runBaseReport.checkCloseDialog())

       {

           super();

       }

    }

    5. create a parm method

    //BP Deviation Documented

    public edit B2B_IndentReportGenerationOnlyDraf editPOStatusDialog(

       boolean     _set,

       B2B_IndentReportGenerationOnlyDraf   _poStatusDialog)

    {

       if (_set)

       {

           sysReportRun.parmPOStatusDialog(_poStatusDialog);

       }

       return sysReportRun.parmPOStatusDialog();

    }

    drag and drop the edit method in form group

    In report:

    Create these methods in report copy paste from that xpo

    1. pack

    2. unpack

    3.dialog

    dialog = Dialog::newFormnameRunbase(formstr(B2B_IndentGenerationReportForm), sysReportRun.runbaseReport());

     

    B2B_IndentGenerationReportForm this is form name replalce your form name their

    4. create parm method

    public B2B_IndentReportGenerationOnlyDraf parmpoStatusDialog(B2B_IndentReportGenerationOnlyDraf _poStatusDialog = poStatusDialog)

    {

       poStatusDialog = _poStatusDialog;

       return poStatusDialog;

    }

     

    that's it

    Don't think to much it is very simple try to understand the code. Know how its working.

    Regards,

    Ganesh

  • In reply to MayurSaini:

    Hi Mayuri,

    Hope the following link is helpful for you

    Overriding method for a control in dialog (RunBase framework)

    Custom lookup for Dialog fields in Axapta

  • In reply to Ganesh408:

    First of all thanks Ganesh for your help

    I will try to implement my requirement according to your concept its almost work , but i'm getting an error when we run the report

    Error::
    A DialogStartGrp group is missing from the form DialogForm. In this group dialog controls are added.
  • In reply to MayurSaini:

    Ok well tried...

    you need to add this group in that form

     

    check my xpo. 

  • In reply to Ganesh408:

    I,m fix these error my report is also work fine .......

    but my custom lookup for customer account field is not filter based on customer group....... i will send you my both lookup method

    // for custgroup look up
    public void lookupCust(FormStringControl _control)
    {
    Query query = new Query();
    QueryBuildDataSource qbds_CustTable;
    SysTableLookup sysTablelookup;

    sysTablelookup = SysTableLookup::newParameters(tableNum(CustTable),_control);
    qbds_CustTable = query.addDataSource(tableNum(CustTable));
    sysTablelookup.addLookupfield(fieldNum(CustTable,CustGroup));
    sysTablelookup.parmQuery(query);
    sysTablelookup.performFormLookup();

    }




    // for custaccount lookup method based on above custgroup value and my custgroup filed value is pass by these ((CustomerGroup.valueStr()))


    public void lookupCust(FormStringControl _control)
    {
    Query query = new Query();
    QueryBuildDataSource qbds_CustTable;
    QueryBuildRange qbr;
    SysTableLookup sysTablelookup;

    if (_control != null)
    {
    sysTablelookup = SysTableLookup::newParameters(tableNum(CustTable),_control);
    qbds_CustTable = query.addDataSource(tableNum(CustTable));
    sysTablelookup.addLookupfield(fieldNum(CustTable,AccountNum));
    qbr = qbds_CustTable.addRange(fieldNum(CustTable, CustGroup));
    qbr.value(CustomerGroup.valueStr());

    sysTablelookup.parmQuery(query);
    sysTablelookup.performFormLookup();
    }

    if (_control == null)
    {
    sysTablelookup = SysTableLookup::newParameters(tableNum(CustTable),_control);
    qbds_CustTable = query.addDataSource(tableNum(CustTable));
    sysTablelookup.addLookupfield(fieldNum(CustTable,AccountNum));
    sysTablelookup.parmQuery(query);
    sysTablelookup.performFormLookup();
    }
    }
  • In reply to MayurSaini:

    First you have to hardcore the cust group value in range query and check. If it is working fine then go to

    qbr.value("10");
    this Technics


    qbr.value(QueryValue(CustomerGroup.valueStr()));
    qbr.value(SysQuery::value(CustomerGroup.valueStr()));

    try this.
  • In reply to Ganesh408:

    thanks my report is completed implemented according to me and its work properly

    but the actually concept for lookup is different , look up value is shown by edit method and in my edit method we use custAccount and custGroupId its automatically show lookup (by default nature of custaccount and custgroupid EDT) ,so my lookup method not call.

    Then first of all we remove both EDT in edit method and Generally take edit of String20 which does not show lookup value after then we implement my look up code which are shown below..........


    // for custgroup
    public void lookup()
    {

    Query query = new Query();
    QueryBuildDataSource qbds_CustGroup;
    SysTableLookup sysTablelookup;
    super();

    sysTablelookup = SysTableLookup::newParameters(tableNum(CustGroup),this);
    qbds_CustGroup = query.addDataSource(tableNum(CustGroup));
    sysTablelookup.addLookupfield(fieldNum(CustGroup,CustGroup));
    sysTablelookup.parmQuery(query);
    sysTablelookup.performFormLookup();
    }




    /// for custAccount.
    public void lookup()
    {
    Query query = new Query();
    QueryBuildDataSource qbds_CustTable;
    QueryBuildRange qbr;
    SysTableLookup sysTablelookup;

    super();

    if (CustomerGroup.valueStr() != "")
    {
    sysTablelookup = SysTableLookup::newParameters(tableNum(CustTable),this);
    qbds_CustTable = query.addDataSource(tableNum(CustTable));
    sysTablelookup.addLookupfield(fieldNum(CustTable,AccountNum));
    qbr = qbds_CustTable.addRange(fieldNum(CustTable, CustGroup));
    qbr.value(CustomerGroup.valueStr());

    sysTablelookup.parmQuery(query);
    sysTablelookup.performFormLookup();
    }

    if (CustomerGroup.valueStr() == "")
    {
    sysTablelookup = SysTableLookup::newParameters(tableNum(CustTable),this);
    qbds_CustTable = query.addDataSource(tableNum(CustTable));
    sysTablelookup.addLookupfield(fieldNum(CustTable,AccountNum));
    sysTablelookup.parmQuery(query);
    sysTablelookup.performFormLookup();
    }
    }

    Finally Ganesh Thank you so much for your appreciate help ..........................
  • In reply to Ganesh408:

    Hello Ganesh .
    I am facing a issues while using the customized lockup by run base that is when i open the report that give the error of "dorun "method ... But as i have not used this method neither in form nor in report.

    Thanks
    Pushpendra
  • In reply to PushpendraSingh:

    Hi pushpendra,

    Have you done that report as i told in above steps?

    If you done that report as above steps...

    I think that is run time issue. So, check you properly and re -design once again. Because i am not facing that problem.

    Regards,
    Ganesh
Related
Recommended