May 30, 2012

How to find All Usr Layer Element in AOT

How to Find all the elements which in present in USR layer

To find all USR layer elements in AOT , you can write job with following code, when you will run this job it will create a new project named "TheAxapta_UsrObject". In this Project you find all elements which is present in USR layer by individual grouping. This a good way to find all USR element.

static void FilterBasedOnLayers(Args _args)
{

    sysprojectfilterrunbase upgradeproject;
    utilelements            theelements;
    ;

    upgradeproject = new sysprojectfilterrunbase();
    upgradeproject.parmProjectNode(systreenode::createProject('theaxapta_UsrObject'));
    upgradeproject.grouping(sysprojectgrouping::AOT);

    while select name, utilLevel, RecordType, ParentId from theelements

    where theelements.utilLevel == UtilEntryLevel::usr
    {
        try
        {
            theelements.reread();
            upgradeproject.doUtilElements(theelements);
        }

        catch (exception::Error)
        {
            throw error('error');
        }
    }

    upgradeproject.write();

    info('finish');
}

When this job is finished you get a new project in your Share Project node.
-Harry

May 29, 2012

How to convert a Amount in Words


Hi Folks,

This code will work for the report as well as Forms also.  Of course this a lengthy code but you can write this in a class also for reuse this code.



-Harry