Santosh.'s profileDynamics AxPhotosBlogLists Tools Help

Blog


    September 30

    Mapping

    How to know if one table belong a map table?

     

    static void Table_Map (Args _args)

    {

         UtilElements UtilElements;

         ;

     

         while select utilElements

         where utilElements.recordType == UtilElementType::TableMap &&

         utilElements.name == tableStr(CustTable)

         {

                info(TableId2Name(UtilElements.parentId));

         }

    }

     When above job is executed the UtilElements will display all the maps which is linked to CustTable.

    September 27

    Calling a Form using Args Class

    Has anyone tried calling a Form through an Args class?

    The Args caller method return the Object value

     

    static void Elearn_Args(Args _args)

    {

         FormRun   formRun;

         ;

         _args     = new Args(formstr(CustTable));

         formRun = ClassFactory::formRunClassOnClient(_args);

     

         if(formRun)

         {

                 formRun.init();

                 formRun.run();

                 sleep(2000);  // Allows the form to display for this many seconds.

         }

         else

                 throw error('Form not found in AOT.');}

    September 25

    Dynamics X++ Job

    Hi All,

     

    Blogging is my passion. So i have decided to write my own blog for the upcoming ERP product - Dynamics AX. Blog is intended to provide code snippets, information on AX. Here is my first sample job

     

    Calling a X++ job from another job

     

    static void Jobs_ExecutingJob(Args _args)

    {

        Args                    args;

        ;

       

        args = new Args();

        args.name(identifierStr(Jobs_MyJob));

       

         // Create a MenuitemAction as Jobs_MyJob & Object Type should be set to Job

         new menuFunction(menuItemActionStr(Jobs_MyJob), MenuItemType::Action).run(args);

    }

     

     

    static void Jobs_MyJob()

    {

        ;

        info("Infolog demo.");

    }

      

    For User Friendly Infolog refer http://blogs.msdn.com/mfp/pages/the-user-friendly-infolog.aspx