Home

Tuesday, May 31, 2016

Microsoft Dynamics AX 2012 Keyboard Shortcut Guide

Microsoft Dynamics AX 2012 Keyboard Shortcuts
The following standard keyboard shortcuts apply to Microsoft Dynamics AX. Note: The shortcut keys described here refer to the United States keyboard layout. Keys on other keyboard layouts might not correspond exactly to the keys on a U.S. keyboard. 

GENERAL WINDOWS AND MENUS NAVIGATION
  • Display the Navigation Pane if it is collapsed: ALT+F1 
  • Display key tips for the File menu: ALT 
  • Display the View menu: ALT+V 
  • Display the Windows menu: ALT+W 
  • Display the Help menu: ALT+H 
  • Turn the auto-hide mode for the Navigation Pane on an off: SHIFT+ALT+F1 
  • Move between modules: CTRL+TAB 
  • In the Navigation Pane tree view, select the next and previous item, respectively: UP ARROW or DOWN ARROW 
  • In the Navigation Pane, expand and collapse the selected item, respectively: RIGHT ARROW and LEFT ARROW 
  • Move the cursor to the address bar: F11 
  • Use the Back function on the address bar: ALT+LEFT ARROW 
  • Use the Forward function on the address bar: ALT+RIGHT ARROW 
  • Display the shortcut menu for the Presence indicator: CTRL+SHIFT+M 
ACTION PANE NAVIGATION
  • Display key tips for the File menu and for Action Pane tabs and groups on the currently displayed tab: ALT 
  • Display key tips for groups in an Action Pane tab: ALT+Key for the tab, and then ALT, Note: If the same key is used for multiple controls, press the key again until the focus is on the control that you want, and then press ENTER. 
  • Display key tips for actions within groups in an Action Pane tab: ALT+Key for the tab, and then ALT+Key for the group, Note: If the same key is used for multiple controls, press the key again until the focus is on the control that you want and then press ENTER. 
  • Hide key tips: 
GRID NAVIGATION
  • Move to the record above the currently selected record: UP ARROW 
  • Move to the record below the currently selected record: DOWN ARROW 
  • Move to the first record: CTRL+HOME
  • Move to the last record: CTRL+END 
  • Move to previous page of records: PAGE UP
  • Move to next page of records: PAGE DOWN
  • Open the selection list for a drop-down list: ALT+DOWN ARROW 
  • Select records in a list from the selected record to the first record in the list: CTRL+SHIFT+HOME 
  • Select records in a list from the first selected record to the last record in the list:CTRL+SHIFT+END 
  • Select all records in a list. CTRL+A 
FORM NAVIGATION
  • Close the current form without saving changes: ESC or ALT+F4 
  • Create a record: CTRL+N
  • Delete a record: ALT+F9
  • If a grid control does not have focus, this keyboard combination selects the first field on the form. If a grid control has focus, this keyboard combination selects multiple records in the grid: CTRL+SHIFT+HOME 
  • If a grid control does not have focus, this keyboard combination selects the last field on the form. If a grid control has focus, this keyboard combination selects multiple records in the grid: CTRL+SHIFT+END 
  • Move to the next control on a non-dialog form: TAB 
  • ENTER (skips buttons; includes fields on all tabs)
  • Move to the previous control on a non-dialog form: SHIFT+TAB (includes buttons; includes fields only on the current tab) 
  • SHIFT+ENTER (skips buttons; includes fields on all tabs) 
  • Move to the first record: CTRL+HOME
  • Move to the last record: CTRL+END
  • Move to the previous record: CTRL+PAGE UP 
  • Move to the next record: CTRL+PAGE DOWN 
  • Move to the next page of records: PAGE DOWN 
  • Move to the previous page of records: PAGE UP 
  • Open a context menu (right-click menu) for the current field: SHIFT+F10 
  • Display the form where the values for the current field are maintained: CTRL+ALT+F4 
  • Print a report of the contents of the current form (auto report): CTRL+P 
  • Refresh the information displayed in the form: F5 
  • Cancel changes and restore the active record: CTRL+F5 
  • Select the button with focus: SPACE 
  • Save changes and close the current form: CTRL+F4 
  • Save changes to a form: CTRL+S 
  • Move to the next tab (when a control on a tab has focus):CTRL+TAB 
  • Move to the previous tab when a control on a tab has focus): CTRL+SHIFT+TAB 
  • Expand all FastTabs: CTRL+SHIFT and then press + 
  • Collapse all FastTabs: CTRL+SHIFT and then press - 
  • Expand the FastTab that has focus: CTRL and then press +
  • Collapse the FastTab that has focus: CTRL and then press - 
  • Move focus to a specific tab: CTRL + the FastTab number 
  • If a FastTab is the second FastTab on a form, then the number of that FastTab is 2. 
  • Select the default button on a dialog form: ENTER 
DATA ENTRY FIELDS NAVIGATION
  • Paste contents from your clipboard into the current field: CTRL+V 
  • Enter the session date in a date field: D+TAB 
  • For a date time field, press D+TAB, enter a time and then press TAB again. 
  • Enter the current date in a date field. T+TAB 
  • For a date time field, press T+TAB, enter a time and then press TAB again. 
  • Enter a date from the current month in a date field: [Day]+TAB 
  • For example, if you enter 12+TAB, the full date for the twelfth of the current month will be displayed. 
  • Enter a date from the current year in a date field: [MonthDay]+TAB 
  • For example, if you enter 0325+TAB, the full date for March 25 of the current year will be displayed. 
  • Calculate an amount in an amount field: [Equation]+TAB 
  • For example, if you enter 4*16+TAB, 64 will be displayed in the field. 
FIND AND FILTER NAVIGATION
  • Use the value in the current field as a filter: CTRL+F (clears existing filters) 
  • Use the value in the current field as a filter: CTRL+K (adds to existing filters) 
  • Filter data by the current field value: ALT+F3 
  • Create filters across all columns that you can filter on in a grid: CTRL+G 
  • Add query criteria to filter on (Query dialog): CTRL+F3 
  • Clear all filters: CTRL+SHIFT+F3 
  • Move to the filter field of the column that the cursor is in: CTRL+UP ARROW 
REPORT VIEWER NAVIGATION
  • Move to the previous page or scroll to the top of the current page: PAGE UP 
  • Move to the next page or scroll to the bottom of the current page: PAGE DOWN 
HIERARCHY DESIGNER NAVIGATION
  • Select the parent of the currently selected node: UP ARROW 
  • Select the child node that is directly under the currently selected node: DOWN ARROW 
  • Select the node that is to the left of the currently selected node: LEFT ARROW 
  • Select the node that is to the right of the currently selected node: RIGHT ARROW 
  • Make the selected node the focus: SPACE 
  • Open the details page related to the selected node: ENTER 
  • Cut the selected node or branch (must be in Edit mode): CTRL+X 
  • Paste cut nodes as children of the selected node: CTRL+V 
  • Open the right-click menu for the selected node: CTRL+N 
  • Remove the selected node and all of its child nodes from the hierarchy: DELETE 
HELP SYSTEM NAVIGATION
  • Display the Help window: F1 
  • Close the Help window: ALT+F4 
  • Print the current Help topic: CTRL+P 
  • Refresh the help topic: F5 
  • Search for words in a help topic: CTRL+F 
  • Select all contents of a topic: CTRL+A 
  • Move the cursor to the search box: CTRL+E 
  • Display the default help topic: ALT+HOME 
  • Copy selected content: CTRL+C 
  • In a table of contents, select the next and previous item, respectively: DOWN ARROW and UP ARROW 
  • In a table of contents, expand and collapse the selected item, respectively: RIGHT ARROW and LEFT ARROW 
  • Move the cursor to the next hidden text or hyperlink, or Expand All or Collapse All at the top of a topic: TAB 
  • Move the cursor to the previous hidden text or hyperlink: SHIFT+TAB 
  • Perform the action for the selected Expand All, Collapse All, hidden text, or hyperlink: ENTER 
  • Move back to the previous Help topic: ALT+LEFT ARROW 
  • Move forward to the next Help topic: ALT+RIGHT ARROW 
  • Scroll small amounts up and down, respectively, in the currently displayed Help topic: UP ARROW and RIGHT ARROW 
  • Scroll larger amounts up and down, respectively, in the currently displayed Help topic: PAGE UP and PAGE DOWN 
  • Display the Options menu: ALT+O 
AOT NAVIGATION
  • Open the AOT: CTRL+D 
  • Open a new Development Workspace: CTRL+SHIFT+W 
  • Open a new Application Workspace: CTRL+W 
  • Save all: CTRL+SHIFT+S 
  • Select all application objects in a node: Select one or more application objects under a top-level node, and then press CTRL+A 
  • Open the editor for an application object: CTRL+SHIFT+F2 
  • Open the editor for a query or table: CTRL+O 
  • Open the Comparison tool: Select one or more application objects, and then press CTRL+G 
  • Compile an application object: F7 
  • Go to the previous node: UP ARROW 
  • Go to the next node: DOWN ARROW 
  • Move the node up: ALT+UP ARROW 
  • Move the node down: ALT+DOWN ARROW 
  • Expand the current node: RIGHT ARROW 
  • Collapse the current node: LEFT ARROW 
  • Select multiple items: CTRL 
  • Cancel the selection of an additional item: CTRL+SPACEBAR 
  • Open the Properties sheet: ALT+ENTER 
  • Open the Import dialog box: Select one or more application objects, and then press CTRL+SHIFT+I 
  • Open the Find dialog box to find an element in the AOT: CTRL+F 
  • Open the Help documentation for an element in the AOT: F1 
CODE EDITOR NAVIGATION - BREAKPOINTS
  • Remove all breakpoints: CTRL+SHIFT+F9 
  • Insert or remove a breakpoint: F9 
  • Enable or disable a breakpoint: CTRL+F9 
  • Open the Breakpoints dialog: SHIFT+F9 
CODE EDITOR NAVIGATION – COMPILATION & HELP
  • Open the Scripts menu: Scripts icon 
  • Open Help: F1 
  • Show method parameter help: CTRL+SHIFT+SPACEBAR 
  • Execute the current job: F5 
  • Compile: F7 
  • Compile and close a method. F8 
  • Stop method execution (break)" CTRL+BREAK 
  • Insert a file: CTRL+ALT+H 
CODE EDITOR NAVIGATION – DELETE
  • Delete from the cursor to the end of the line: Use SHIFT+END to select to end of line and then DELETE 
  • Delete word to the right of the cursor: CTRL+DELETE 
  • Delete the word to the left of the cursor: CTRL+BACKSPACE 
  • Delete the current line: CTRL+X (with cursor in line, no selection) 
CODE EDITOR NAVIGATION – EDIT
  • Insert script: <SCRIPT NAME> 
  • Insert document header: /// 
  • Comment selection: CTRL+E, C 
  • Uncomment selection: CTRL+E, U 
  • Convert selection to lowercase: CTRL+U OR CTRL+SHIFT+U
  • Convert selection to uppercase: CTRL+U OR CTRL+SHIFT+U
  • Display all methods and properties for a selected class: CTRL+SPACEBAR 
  • Copy selection: CTRL+C (with text selected) 
  • Copy line: CTRL+C (with cursor in line, no selection) 
CODE EDITOR NAVIGATION – FIND & REPLACE
  • Open the Find dialog: CTRL+F 
  • Open the Replace dialog: CTRL+R 
  • Start incremental search: CTRL+I 
  • Move to next incremental search match in method: CTRL+I 
  • Reverse the incremental search direction: CTRL+Shift+I 
  • Remove a character from the incremental search string: BACKSPACE 
  • Stop the incremental search: ESC 
CODE EDITOR NAVIGATION – GO TO
  • Go to a specific line: CTRL+G 
  • Go to the next page: PAGE UP 
  • Go to the previous page: PAGE DOWN 
  • Go to the top of the code: CTRL+HOME 
  • Go to the bottom of the code: CTRL+END 
  • Go to the start of line: HOME 
  • Go to the end of line: END 
  • Move one word to the left: CTRL+LEFT ARROW 
  • Move one word to the right: CTRL+RIGHT ARROW 
  • Go to the method definition: F12 
  • Go to the next error message: F4 
CODE EDITOR NAVIGATION – LOOKUP
  • Look up a label: CTRL+ALT+SPACEBAR 
  • Show label text: CTRL+L 
  • Look up a definition: F12 
  • Show the syntax of a method or property: CTRL+SPACEBAR OR CTRL+SHIFT+SPACEBAR
CODE EDITOR NAVIGATION – SAVE
  • Save the selected text to a separate file: ALT+S 
  • Close the current TAB, discarding all changes since the last save: F6 
  • Close and save the current code editor window: F8 
  • Close the current window: CTRL+F4 
CODE EDITOR NAVIGATION – SELECT
  • Select all: CTRL+A 
  • Cancel a selection: ESC 
  • Select columns: ALT+MOUSE SELECT 
  • Select a line: ALT+L 
  • Select one word to the left: CTRL+SHIFT+LEFT ARROW 
  • Select one word to the right: CTRL+SHIFT+RIGHT ARROW 
  • Select text from the cursor to the start of the line: SHIFT+HOME 
  • Select text from the cursor to the end of the line: SHIFT+END 
  • Select the previous page: SHIFT+PAGE UP 
  • Select the next page: SHIFT+PAGE DOWN 
  • Select text from the cursor to the top of the code: CTRL+SHIFT+HOME 
  • Select text from the cursor to the bottom of the code: CTRL+SHIFT+END 
  • Indent the selected text: TAB 
  • Remove indentation: SHIFT+TAB 
  • Select area/column/block: ALT+MOUSE SELECT 
  • Cancel selection: ESC 
  • Show white space: CTRL+SHIFT+S 
CODE EDITOR NAVIGATION – UNDO & REDO
  • Undo the last action: CTRL+Z (previous ten actions) 
  • Redo the last action after an Undo: CTRL+Y (previous ten actions) 

Monday, May 30, 2016

Find customer city in ax 2012

static void Job3(Args _args)
{
 Str city,s;
    s = CustTable::find('US-010').name();
  City = LogisticsPostalAddress::findByLocation(DirPartyTable::findRec(CustTable::find('US-011').Party).PrimaryAddressLocation).City;
    info(strFmt("%1 ----> %2",s,City));
}

static void VendorAddress(Args _args)
{

    VendTable vend;
    DirPartyTable party;
    LogisticsLocation loc;
    LogisticsPostalAddress postalAddress;
    Str city,s,l;
    select vend where vend.AccountNum == "000001";
    select party where party.RecId == vend.Party;
    select loc where loc.RecId == party.PrimaryAddressLocation;
    select postalAddress where postalAddress.Location == loc.RecId ;
    print postalAddress.Address;
    l = LogisticsPostalAddress::findByLocation(LogisticsLocation::find(DirPartyTable::findRec(VendTable::find('000001').Party).PrimaryAddressLocation).RecId).Address;
    s =LogisticsPostalAddress::findByLocation(DirPartyTable::findRec(VendTable::find('000001').Party).PrimaryAddressLocation).Address;
    city = LogisticsPostalAddress::findByLocation(DirPartyTable::findRec(CustTable::find('US-011').Party).PrimaryAddressLocation).City;
    PRINT s;
    PRINT l;
    PRINT  city;
    //pAUSE;

     select postalAddress join loc where postalAddress.Location == loc.RecId
                          join party where loc.RecId == party.PrimaryAddressLocation
                          join vend  where party.RecId == vend.Party
                                     && vend.AccountNum == "000001";
   
      print postalAddress.Address;
     pause;
}

Thursday, May 26, 2016

Select only one checkbox

Add Range in query ax 2012

static void AddRangeToQuery(Args _args)
{
    Query q = new Query();  // Create a new query.
    QueryRun qr;
    CustTable ct;
    QueryBuildDataSource qbr1;
    str strTemp;
    ;

    // Add a single datasource.
    qbr1 = q.addDataSource(tablenum(CustTable));
    // Name the datasource 'Customer'.
    qbr1.name("Customer");

    // Create a range value that designates an "OR" query like:
    // customer.AccountNum == "4000" || Customer.CreditMax > 2500.

    // Add the range to the query data source.
    qbr1.addRange(fieldNum(CustTable, AccountNum)).value(
    strFmt('((%1.%2 == "US-012") || (%1.%3 > 100))',
        qbr1.name(),
        fieldStr(CustTable, AccountNum),
        fieldStr(CustTable, CreditMax)));

    // Print the data source.
    print qbr1.toString();
    info(qbr1.toString());

    // Run the query and print the results.
    qr = new QueryRun(q);

    while (qr.next())
    {
        if (qr.changedNo(1))
        {
            ct = qr.getNo(1);
            strTemp = strFmt("%1 , %2", ct.AccountNum, ct.CreditMax);
            //print strTemp;
            info(strTemp);
        }
    }
    pause;
}

Break Ledger Dimension ax 2012

static void Job29(Args _args)
{
    GeneralJournalAccountEntry generalJournalAccountEntry;
    List strlist=new List(Types::String);
    ListIterator    iterator;
    str value,v1,v2,v3;
    container       packedList;
    ;
     select generalJournalAccountEntry where generalJournalAccountEntry.RecId == 5637146331 ;
    value = generalJournalAccountEntry.LedgerAccount;
    strlist=strSplit(value,'-');
    iterator = new ListIterator(strlist);
    while(iterator.more())
    {
        packedList += iterator.value();
        iterator.next();

    }
    v1 = conPeek( packedList,1);
    v2 = conPeek( packedList,2);
    v3 = conPeek( packedList,3);

   //info(conPeek(packedList,1));
    info(strFmt("%1",value));
    info(v1);
     info(v2);
     info(v3);

}

Wednesday, May 4, 2016

Create vendor from code Ax 2012 X++

static void SPS(Args _args)
{
    #define.Name("First Middle Last")
    #define.FirstName("First ")
     #define.MiddleName("Middle ")
    #define.LastName("Last")
    #define.PostalAddressName("Postal address")
    #define.City("City Name")
    #define.County("India")
    #define.Country("India")
    #define.Street("This is street Address")
    #define.State("STY")
    #define.ZipCode("100092")
    #define.ElectronicAddressName("Electronic address")
    #define.Locator("first@microsoft.com")
    #define.LocatorExt("")
    #define.VendAccount("VendXPP001")
    #define.VendGroup("10")
    #define.Currency("INR")
    #define.CostCenter("010")
    #define.Department("025")

    DirPerson                   dirPerson;
    DirPersonName               dirPersonName;
    LogisticsLocation           logisticsLocation;
    LogisticsPostalAddress      logisticsPostalAddress;
    LogisticsElectronicAddress  logisticsElectronicAddress;
    VendTable                   vendTable;

    try
    {
        ttsbegin;

        //Person
        dirPerson.clear();
        dirPerson.initValue();
        dirPerson.Name = #Name;

        if (dirPerson.validateWrite())
        {
            dirPerson.insert();

            if (dirPerson)
            {
                //Person name
                dirPersonName.clear();
                dirPersonName.initValue();
                dirPersonName.FirstName = #FirstName;
                dirPersonName.MiddleName = #MiddleName;
                dirPersonName.LastName = #LastName;
                dirPersonName.Person = dirPerson.RecId;
                dirPersonName.ValidFrom = DateTimeUtil::utcNow();
                dirPersonName.ValidTo = DateTimeUtil::maxValue();

                if (dirPersonName.validateWrite())
                {
                    dirPersonName.insert();
                }
                else
                    throw error("Person name");

                //Location
                logisticsLocation = LogisticsLocation::create(#PostalAddressName, NoYes::Yes);

                //Party location
                DirParty::addLocation(dirPerson.RecId, logisticsLocation.RecId, true, true, false, [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Home).RecId]);

                //Postal address
                logisticsPostalAddress.clear();
                logisticsPostalAddress.initValue();
                logisticsPostalAddress.City = #City;
                logisticsPostalAddress.County = #County;
                logisticsPostalAddress.CountryRegionId = #Country;
                logisticsPostalAddress.Street = #Street;
                logisticsPostalAddress.State = #State;
                logisticsPostalAddress.ZipCode = #ZipCode;
                logisticsPostalAddress.Address = LogisticsPostalAddress::formatAddress(
                #Street, #ZipCode, #City, #Country, #State, #County);
                logisticsPostalAddress.Location = logisticsLocation.RecId;
                logisticsPostalAddress.ValidFrom = DateTimeUtil::utcNow();
                logisticsPostalAddress.ValidTo = DateTimeUtil::maxValue();

                if (logisticsPostalAddress.validateWrite())
                {
                    logisticsPostalAddress.insert();
                }
                else
                    throw error("Postal address");

                //Location
                logisticsLocation = LogisticsLocation::create(#ElectronicAddressName, NoYes::No);

                //Party location
                DirParty::addLocation(dirPerson.RecId, logisticsLocation.RecId, false, true, false);

                //Electronic address
                logisticsElectronicAddress.clear();
                logisticsElectronicAddress.initValue();
                logisticsElectronicAddress.Location = logisticsLocation.RecId;
                logisticsElectronicAddress.Type = LogisticsElectronicAddressMethodType::Email;
                logisticsElectronicAddress.Locator = #Locator;
                logisticsElectronicAddress.LocatorExtension = #LocatorExt;


                if (logisticsElectronicAddress.validateWrite())
                {
                    logisticsElectronicAddress.insert();
                }
                else
                    throw error("Electronic address");

                //Vendor
                vendTable.clear();
                vendTable.initValue();
                //vendTable.Currency = "";

                vendTable.AccountNum = #VendAccount;
                //vendTable.AccountNum = NumberSeq::newGetNum(VendParameters::numRefVendAccount()).num();
                vendTable.Party = dirPerson.RecId;

                vendTable.VendGroup = #VendGroup;
                vendTable.initFromVendGroup(VendGroup::find(#VendGroup));

                vendTable.Currency = #Currency;
                vendTable.DefaultDimension = AxdDimensionUtil::getDimensionAttributeValueSetId(
                [2, "CostCenter", #CostCenter, "Department", #Department]);

                if (vendTable.validateWrite())
                {
                    vendTable.insert();
                }
                else
                    throw error("Vendor");
            }
        }
        else
            throw error("Person");

        ttscommit;
    }
    catch
    {
        error("Error!");
        return;
    }

    info("Done!");
}

Change Digit in Indian text Ax -2012


public static TempStr numeralsToTxt_IN(real _num)
{  
          real _num = 998.89;
          Str C;
   
    C =Global::numeralsToTxt_IN(_num);  // for Indian currency, need to add below code
}


In the Global class you can add below code


static TempStr numeralsToTxt_IN(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);

int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, lakhs, crores;

int64 temp;
str 200 returntxt;
str 200 pennytxt;
int penny;

real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}

real checkPower(real _test, int64 _power)
{
int64 numOfPower;

if (_test >= _power)
{
numOfPower = _test div _power;
if (numOfPower >= 100)
{
temp = numOfPower div 100;
returntxt = returntxt + ' ' + ones[temp] + ' ' + hundreds;
numOfPower = numOfPower mod 100;
}
if (numOfPower >= 20)
{
temp = numOfPower div 10;
returntxt = returntxt + ' ' + tenths[temp];
numOfPower = numOfPower mod 10;
}
if (numOfPower >= 1)
{
returntxt = returntxt + ' ' + ones[numOfPower];
numOfPower = numOfPower mod 10;
}
switch(_power)
{
case 10000000 :
{
returntxt = returntxt + ' ' + Crores;
_test = modOperator(_test, 10000000);
break;
}
case 100000 :
{
returntxt = returntxt + ' ' + lakhs;
_test = modOperator(_test, 100000);
break;
}
case 1000 :
{
returntxt = returntxt + ' ' + thousands;
_test = modOperator(_test, 1000);
break;
}
case 100 :
{
returntxt = returntxt + ' ' + hundreds;
_test = modOperator(_test, 100);
break;
}
}
}
return _test;
}

#Define.text_1('One')
#Define.text_2('Two')
#Define.text_3('Three')
#Define.text_4('Four')
#Define.text_5('Five')
#Define.text_6('Six')
#Define.text_7('Seven')
#Define.text_8('Eight')
#Define.text_9('Nine')
#Define.text_10('Ten')
#Define.text_11('Eleven')
#Define.text_12('Twelve')
#Define.text_13('Thirteen')
#Define.text_14('Fourteen')
#Define.text_15('Fifteen')
#Define.text_16('Sixteen')
#Define.text_17('Seventeen')
#Define.text_18('Eighteen')
#Define.text_19('Nineteen')
#Define.text_20('Twenty')
#Define.text_30('Thirty')
#Define.text_40('Forty')
#Define.text_50('Fifty')
#Define.text_60('Sixty')
#Define.text_70('Seventy')
#Define.text_80('Eighty')
#Define.text_90('Ninety')
#Define.text_100('Hundred')
#Define.text_1000('Thousand')
#Define.text_100000('Lakh')
#Define.text_10000000('Crore')
#Define.text_and('Rupees and')
#Define.text_paise('Paise Only')
#Define.text_ruppe('Rupees Only')

ones[1] = #text_1;
ones[2] = #text_2;
ones[3] = #text_3;
ones[4] = #text_4;
ones[5] = #text_5;
ones[6] = #text_6;
ones[7] = #text_7;
ones[8] = #text_8;
ones[9] = #text_9;
ones[10] = #text_10;
ones[11] = #text_11;
ones[12] = #text_12;
ones[13] = #text_13;
ones[14] = #text_14;
ones[15] = #text_15;
ones[16] = #text_16;
ones[17] = #text_17;
ones[18] = #text_18;
ones[19] = #text_19;

tenths[1] = 'Not used';
tenths[2] = #text_20;
tenths[3] = #text_30;
tenths[4] = #text_40;
tenths[5] = #text_50;
tenths[6] = #text_60;
tenths[7] = #text_70;
tenths[8] = #text_80;
tenths[9] = #text_90;

hundreds = #text_100;
thousands = #text_1000;
lakhs = #text_100000;
crores = #text_10000000;



test = checkPower(test, 10000000);
test = checkPower(test, 100000);
test = checkPower(test, 1000);
test = checkPower(test, 100);

if (test >= 20)
{
numOfTenths = test div 10;
returntxt = returntxt + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths mod 10;
test = test mod 10;
}
if (test >= 1)
{
numOfTenths = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}

if (numOfPennies)
{
if (numOfPennies >= 20)
{
penny = numOfPennies div 10;
pennytxt = tenths[penny];
numOfPennies = numOfPennies mod 10;
}
if (numOfPennies >= 1)
{
pennytxt = pennytxt + ' ' + ones[numOfPennies];
}
returntxt = returntxt + ' ' + #text_and + ' ' + pennytxt + ' ' +#text_paise;
}
else
{
returntxt = returntxt + ' ' + #text_ruppe;
}

return returntxt;
}