Perfil de Santosh KumarSantosh Kumar Paruvella'...BlogListasLibro de visitasMás Herramientas Ayuda

Blog


22 septiembre

List of the classes, which are implemented by interface.

Here is the following code to list out the classes, which are implemented by AifIntegrationAdapter interface.

static void getListOfImplementClasses(Args _args)
{
    SysDictClass                    dictClass;
    List                            dataContainerClassList;
    ListEnumerator                  le;
    classId                         dataClassId;
    str                             classnames;
    ;

    dictClass    = new SysDictClass(classnum(AifIntegrationAdapter));
    dataContainerClassList = dictClass.implementedBy();

    le = dataContainerClassList.getEnumerator();

    while (le.moveNext())
    {
        dataClassId = le.current();
        dictClass   = new SysDictClass(dataClassId);
        if (!dictClass.isInterface())
        {
            classnames += dictClass.name() +";";
        }
    }

    info(classnames);

}
20 septiembre

Creation of class object during the run time

Depends on particular action if we want to create the class object during the run time..

Here you can find the following code…

Here we have actions like (Warning, Question, SendMail). Based on these actions we need to instantiate the particular class object.

public static void getAction(ClassId _classId)

{

    SysDictClass                    sysDictClass;

    I4C_IToleranceExceptionAction   toleranceExceptionAction;

    InventTrans                     inventTrans;

    sysDictClass                = new SysDictClass(_classId);

    toleranceExceptionAction    = sysDictClass.makeObject();

    select firstonly inventTrans order by InventTransId desc;

    toleranceExceptionAction.validateInventTrans(inventTrans);

}

Same thing we can find in standard Dynamics Ax.

\Classes\AifAdapterManager\addAdapter

In the addAdapter method based on the Adapter class id (here also we have types of adapters like FileSystemAdapter, Biztalk, MSMQ) the corresponding class object will be created. Here we are using the interface called AifIntegrationAdapter.

 

Report with out dialog interactions

View the reports without dialog interactions.

static void RunReportWithOutDialogInteraction(Args _args)

{

    Args args;

    SysReportRun reportRun;

    ;

    args = new Args();

    args.name(reportstr(Cust));

    reportRun = classFactory.reportRunClass(args);

    reportRun.query().interactive(false);

    reportRun.report().interactive(false);

    reportRun.setTarget(PrintMedium::Screen);

    reportRun.run();

}