Thursday 13 August 2015

Custom barcode and MICR fonts on SSRS reports from AX 2012 display correctly but will not print or export

So with AX 2012 you may want to display a custom, barcode, or micr font on a report to print for the bank or factory floor. By default a lot of these fonts get installed but some do not. What I have found out is that it will display correctly within the report window but whenever you try to print it or export it does not export the font correctly. In order to resolve the issue the following needs to be done
  1. Install font on AOS
    1. If you are running an AX Cluster be sure to install it on all AOS's
  2. Install font on SQL/SSRS box
    1. If you are running a SQL cluster be sure to install it on all AOS's
  3. When installing be sure to install the font thru the control panel>fonts and not C:\windows\fonts for some odd reason windows server 2012 R1+ does not always install the font correctly when you copy to the specific folder but it does if you use the control panel
  4. Reboot SQL boxes
  5. Reboot AX AOS boxes


If this does not work try reinstalling the font thru the control panel.

Tuesday 4 August 2015

Fixing database is in use error while restore database from backup

Method 1
declare @sql as varchar(20), @spid as int

select @spid = min(spid)  from master..sysprocesses  where dbid = db_id('<database_name>')
and spid != @@spid  

while (@spid is not null)
begin
    print 'Killing process ' + cast(@spid as varchar) + ' ...'
    set @sql = 'kill ' + cast(@spid as varchar)
    exec (@sql)

    select
        @spid = min(spid)
    from
        master..sysprocesses
    where
        dbid = db_id('<database_name>')
        and spid != @@spid
end

print 'Process completed...'


Method 2

select spid from master..sysprocesses where dbid =db_id('<database_name>') and spid <> @@spid


SELECT *
FROM sys.sysprocesses
WHERE dbid = DB_ID('<database_name>')

Job for Free Text Invoice

static void CopyOfInvoiceText(Args _args)
{
    DirPerson DirPerson;

    SysExcelApplication     application;
    SysExcelWorkbooks       workbooks;
    SysExcelWorkbook        workbook;
    SysExcelWorksheets      worksheets;
    SysExcelWorksheet       worksheet;
    SysExcelCells           cells;
    COMVariantType          type;
    OMOperatingUnit         OMOperatingUnit;
    int                     row=1,site;

    Name                                name,titlename,IdentificationNumber;
    FileName                            filename;

    CustInvoiceTable CustInvoiceTable,CustInvoiceTable_recId;
    CustInvoiceline CustInvoiceline,CustInvoiceline_loc;

    SourceDocumentHeader SourceDocumentHeader,SourceDocumentHeader_loc;
    SourceDocumentLine SourceDocumentLine,SourceDocumentLine_loc,SourceDocumentLine_upd;

    Hcmi9DocumentList Hcmi9DocumentList,Hcmi9DocumentList_loc;
    HcmPersonIdentificationNumber HcmPersonIdentificationNumber;
    Hcmi9Eligibility Hcmi9Eligibility;
            HcmWorkerTitle HcmWorkerTitle;
    DirPartyName  Initials,KnownAs;
    RecId   PersonalTitleRecid,PersonalSuffixRecid;
    HcmWorker HcmWorker_loc,HcmWorker;
    Hcmi9DocumentNum  DocumentNum,I9Status;
    Hcmi9Document Hcmi9Document;
    HcmEmployment HcmEmployment;
    int64 Strvalue;
    NoYes NoYes;
    str CustomerAccount,PersonalTitle,Personalsuffix;
    DirNameAffix DirNameAffix,DirNameAffix_loc;
    TransDate InvoiceDate;
    str InvoiceAccount,cur,lang;
    recid reciddesc;
    real Quantity,Amount;
    ;
    application = SysExcelApplication::construct();
    workbooks   = application.workbooks();

   filename = "C:\\Users\\UmeshP\\Desktop\\oct 14\\FreeTaxInvoiceJobTemplate.xlsx";
    //"E:\\WA-DataMigration\\WADataImports\\ResourceRequirementTemplate.xlsx";
    ttsBegin;

    try
    {
        workbooks.open(filename);
    }
    catch (Exception::Error)
    {
        throw error("File cannot be opened.");
    }
    workbook    = workbooks.item(1);
    worksheets  = workbook.worksheets();
    worksheet   = worksheets.itemFromNum(1);
    cells       = worksheet.cells();
   // select SourceDocumentLine_loc order by SourceDocumentLine_loc.recid desc where SourceDocumentLine_loc.SourceRelationType == 1209;
    select SourceDocumentHeader_loc order by SourceDocumentHeader_loc.recid desc;
    do
    {
        row++;
          CustomerAccount= cells.item(row, 1).value().bStr();// comment this
         if(CustomerAccount == "")
            CustomerAccount   = int2str(cells.item(row, 1).value().double());

        lang =  cells.item(row, 17).value().bStr();



          InvoiceDate= cells.item(row, 3).value().date();

        name = cells.item(row, 2).value().bStr();
       // KnownAs = cells.item(row, 6).value().bStr();

        InvoiceAccount = cells.item(row, 5).value().bStr();
         if(InvoiceAccount == "")
            InvoiceAccount   = int2str(cells.item(row, 5).value().double());

        cur = cells.item(row, 7).value().bStr();
     
        Quantity = cells.item(row, 11).value().double();
     
        Amount = cells.item(row, 6).value().double();
     
        IdentificationNumber= cells.item(row, 10).value().bStr();
         if(IdentificationNumber == "")
            IdentificationNumber   = int2str(cells.item(row, 10).value().double());

    SourceDocumentLine_loc.recid =  SourceDocumentLine_loc.recid;
      //  select SourceDocumentLine_upd where SourceDocumentLine_upd.recid == SourceDocumentLine_loc.recid;

    CustInvoiceTable.OrderAccount = CustomerAccount;
            CustInvoiceTable.InvoiceDate = InvoiceDate;
        CustInvoiceTable.InvoiceAccount = InvoiceAccount;
        CustInvoiceTable.CurrencyCode = cur;
        CustInvoiceTable.LanguageId = lang;
//custInvoiceTable.modifiedField(fieldNum(CustInvoiceTable, OrderAccount));
      //  custInvoiceTable.SourceDocumentHeader = SourceDocumentHeader_loc.RecId;
        //custInvoiceTable.SourceDocumentLine = SourceDocumentLine_upd.recid;
        CustInvoiceTable.insert();
        SourceDocumentLine_loc.recid = SourceDocumentLine_loc.recid - 1;
       
        select CustInvoiceTable_recId order by CustInvoiceTable_recId.createdDateTime desc;// where CustInvoiceTable_recId.SourceDocumentHeader == custInvoiceTable.SourceDocumentHeader;
        CustInvoiceline_loc.ParentRecId = CustInvoiceTable_recId.RecId;
        CustInvoiceline_loc.Quantity = Quantity;
        CustInvoiceline_loc.AmountCur = Amount;
        CustInvoiceline_loc.insert();
     
        ////////
     
         SourceDocumentHeader.AccountingStatus = SourceDocumentAccountingStatus::InProcess;
        SourceDocumentHeader.SourceRelationType =1209;
        SourceDocumentHeader.TypeEnumName = "SourceDocument_CustomerInvoice";
        SourceDocumentHeader.TypeEnumValue = 2;
        SourceDocumentHeader.insert();

        select SourceDocumentHeader_loc order by SourceDocumentHeader_loc.RecId desc;

        SourceDocumentLine.AccountingStatus = SourceDocumentLineAccountingStatus::Draft;
        SourceDocumentLine.SourceDocumentHeader = SourceDocumentHeader_loc.RecId;
        SourceDocumentLine.SourceRelationType = 1209;
        SourceDocumentLine.TypeEnumName = "SourceDocumentLine_CustomerInvoice";
        SourceDocumentLine.TypeEnumValue =4;
        SourceDocumentLine.insert();

        select SourceDocumentLine_loc order by SourceDocumentLine_loc.recid desc;

          select forUpdate CustInvoiceTable order by CustInvoiceTable.createdDateTime desc;// where CustInvoiceTable.SourceDocumentHeader == 0;
        if(CustInvoiceTable)
    {
        CustInvoiceTable.SourceDocumentHeader = SourceDocumentHeader_loc.RecId;
        CustInvoiceTable.SourceDocumentLine = SourceDocumentLine_loc.RecId;
        CustInvoiceTable.update();

    }
     
          type = cells.item(row+1, 1).value().variantType();
        info("Record inserted");
    }
    while (type != COMVariantType::VT_EMPTY);
    application.quit();
    ttsCommit;



}

Import and create GL transactions (Ledger and Project type) into AX 2012 using x++ code - csv file

#public class LedgerImportNew extends RunBase
        #{
        #    CommaIo                     csvFile;
        #    Filename                    filename;
        #    DialogField                 dialogFilename;
        #    container                   readCon;
        #    container                   ledgerDimensions, offsetDimensions;
        #    counter                     icount,inserted;
        #    Amount                      amount;
        #    LedgerJournalACType         ledgerJournalACType;
        #    ledgerJournalName           ledgerJournalName;
        #    LedgerJournalTable          ledgerJournalTable;
        #    LedgerJournalTrans          ledgerJournalTrans;
        #    LedgerJournalTrans_Project  ledgerProjects;
        #
        #
        #    #define.CurrentVersion(2)
        #    #localmacro.CurrentList
        #        filename,
        #        insertIncorrectRecords,
        #    #endmacro
        #
        #    #localmacro.ListVersion1
        #        filename,
        #        insertIncorrectRecords
        #    #endmacro
        #
        #    #File
        #
        #}

        #public Object dialog()
        #{
        #    DialogRunbase       dialog = super();
        #    ;
        #    dialogFilename  = dialog.addField(extendedTypeStr(FilenameOpen));
        #
        #    dialogFilename.value(filename);
        #    dialog.filenameLookupFilter(["All files", #AllFiles]);
        #
        #    return dialog;
        #}
        #

        #public boolean getFromDialog()
        #{
        #    filename                = dialogFilename.value();
        #
        #    return true;
        #}

        #public LedgerDimensionAccount getLedgerDimension(AccountNum _accountNum)
        #{
        #    MainAccount                 mainAccount;
        #
        #    RefRecId                    accountStructureId;
        #    List                        dimensionList = new List(Types::Class);
        #    DimensionDefaultingEngine   dimensionDefaultingEngine;
        #    ;
        #
        #    mainAccount = MainAccount::findByMainAccountId(_accountNum);
        #
        #    accountStructureId = DimensionHierarchy::getAccountStructure(mainAccount.RecId);
        #
        #    if(mainAccount)
        #    {
        #        dimensionDefaultingEngine = DimensionDefaultingEngine::constructForMainAccountId(mainAccount.RecId, accountStructureId);
        #        dimensionDefaultingEngine.applyDimensionSources(dimensionList);
        #
        #        return dimensionDefaultingEngine.getLedgerDimension();
        #    }
        #    else
        #        return 0;
        #}

        #void run()
        #{
        #    boolean                             first = true;
        #    MainAccount                         mainAccount;
        #    DimensionAttributeValueCombination  dimensionAttributeValueCombination;
        #    MainAccountNum                      mainAccountNum;
        #    NumberSequenceTable                 numberSequenceTable;
        #    LedgerJournalEngine_Daily           ledgerJournalEngine_Daily;
        #    Voucher                             voucher;
        #    DimensionLedgerAccountType          ledgerAccountType;
        #    str                                 accountType;
        #    Amount                              amountCurDebit,amountCurCredit;
        #    container                           conSplitValue;
        #    projTable                           projTable;
        #    DimensionAttributeValueCombination  ledgerDimension;
        #    ProjId                              projid;
        #    ;
        #
        #    csvFile = new CommaIO(filename, 'r');
        #    try
        #    {
        #        if (csvFile)
        #        {
        #            ttsbegin;
        #            if(first) //Create Journal Header
        #            {
        #                select firstOnly ledgerJournalName where ledgerJournalName.JournalType == LedgerJournalType::Daily;
        #
        #                if(!ledgerJournalName.RecId)
        #                {
        #                    throw error ("ledgerJournalName doesn't exgist");
        #                }
        #
        #                ledgerJournalTable.clear();
        #                ledgerJournalTable.initValue();
        #                ledgerJournalTable.JournalNum    = JournalTableData::newTable(ledgerJournalTable).nextJournalId();
        #                ledgerJournalTable.journalType   = LedgerJournalType::Daily;
        #                ledgerJournalTable.JournalName   = ledgerJournalName.JournalName;
        #                ledgerJournalTable.Name          = ledgerJournalName.Name;
        #                ledgerJournalTable.initFromLedgerJournalName(ledgerJournalName.JournalName);
        #                ledgerJournalTable.insert();
        #
        #                first = false;
        #            }
        #
        #            numberSequenceTable = NumberSequenceTable::find(LedgerJournalName::find(ledgerJournalTable.JournalName).NumberSequenceTable);
        #
        #            voucher =  NumberSeq::newGetVoucherFromCode(numberSequenceTable.NumberSequence).voucher();
        #
        #            while (csvFile.status() == IO_Status::OK)
        #            {
        #                readCon = csvFile.read();
        #
        #                icount++;
        #
        #                amountCurDebit = 0;
        #                amountCurCredit = 0;
        #
        #                if (readCon && icount > 1)//dont insert first record of file : header
        #                {
        #                    amountCurDebit = conPeek(readCon,7);
        #                    amountCurCredit = conPeek(readCon,8);
        #
        #                    //split and read accountNumber and Department values
        #                    //AccountNum = conpeek(conSplitValue,1)
        #                    //Department = conpeek(conSplitValue,2)
        #                    conSplitValue = this.splitAccountNumAndDept(strLRTrim(conPeek(readCon,5)));
        #
        #                    if(amountCurDebit > 0 || amountCurCredit > 0)
        #                    {
        #                        //Create Trans ...
        #
        #                        ledgerJournalTrans.clear();
        #                        ledgerJournalTrans.initValue();
        #                        ledgerJournalTrans.JournalNum         = ledgerJournalTable.JournalNum ;
        #                        ledgerJournalTrans.Txt                = conPeek(readCon,6);
        #                        ledgerJournalTrans.transDate          = str2Date(conPeek(readCon,1),213);
        #
        #                        accountType = strLRTrim(conPeek(readCon,3));
        #
        #                        if(enum2str(LedgerJournalACType::Project) == accountType)
        #                        {
        #                            ledgerJournalTrans.AccountType   = LedgerJournalACType::Project;
        #                        }
        #                        else if(accountType == "")
        #                        {
        #                            ledgerJournalTrans.AccountType   = LedgerJournalACType::Ledger;
        #                        }
        #
        #                       //use the below code if need to read account type from account number
/* type              = enum2str(MainAccount::findByMainAccountId(strLRTrim(conPeek(conSplitValue,1))).Type);
        #
        #                        if(enum2str(LedgerJournalACType::Bank) == type)
        #                        ledgerJournalTrans.AccountType   = LedgerJournalACType::Bank;
        #                        else if(enum2str(LedgerJournalACType::Cust) == type)
        #                        ledgerJournalTrans.AccountType   = LedgerJournalACType::Cust;
        #                        else if(enum2str(LedgerJournalACType::FixedAssets) == type)
        #                        ledgerJournalTrans.AccountType   = LedgerJournalACType::FixedAssets;
        #                        else if(enum2str(LedgerJournalACType::Ledger) == type)
        #                        ledgerJournalTrans.AccountType   = LedgerJournalACType::Ledger;
        #                        else if(enum2str(LedgerJournalACType::Project) == type)
        #                        ledgerJournalTrans.AccountType   = LedgerJournalACType::Project;
        #                        else if(enum2str(LedgerJournalACType::Vend) == type)
        #                        ledgerJournalTrans.AccountType   = LedgerJournalACType::Vend;*/
        #
        #                        if( ledgerJournalTrans.AccountType   == LedgerJournalACType::Project)
        #                        {
        #                            projid = strLRTrim(conPeek(readCon,5));
        #
        #                            select firstonly projTable join RecId from ledgerDimension where ledgerDimension.DisplayValue == projTable.ProjId && projTable.ProjId == projid;
        #
        #                            ledgerJournalTrans.LedgerDimension = ledgerDimension.RecId;
        #                        }
        #                        else
        #                        {
        #                            ledgerJournalTrans.LedgerDimension    = this.getLedgerDimension(strLRTrim(conPeek(conSplitValue,1)));
        #                        }
        #
        #                        ledgerJournalTrans.AmountCurDebit     = amountCurDebit;
        #                        ledgerJournalTrans.AmountCurCredit    = amountCurCredit;
        #                        ledgerJournalTrans.Company            = strLRTrim(conPeek(readCon,2));
        #                        ledgerJournalTrans.CurrencyCode       = strLRTrim(conPeek(readCon,9));
        #                        ledgerJournalTrans.voucher = voucher;
        #                        ledgerJournalTrans.insert();
        #
        #                        if( ledgerJournalTrans.AccountType   == LedgerJournalACType::Project)
        #                        {
        #
        #                           if(!LedgerJournalTrans_Project::checkExist(ledgerJournalTrans.RecId))
        #                           {
        #                                ledgerProjects.clear();
        #                                ledgerProjects.initValue();
        #                                ledgerProjects.CategoryId = strLRTrim(conPeek(readCon,4));
        #                                ledgerProjects.RefRecId = ledgerJournalTrans.RecId;
        #                                ledgerProjects.ProjId = strLRTrim(conPeek(readCon,5));
        #                                ledgerProjects.insert();
        #                            }
        #                            else
        #                            {
        #                                select forUpdate ledgerProjects where ledgerProjects.RefRecId==ledgerJournalTrans.RecId;
        #
        #                                if(ledgerProjects)
        #                                {
        #                                    ledgerProjects.CategoryId = strLRTrim(conPeek(readCon,4));
        #                                    ledgerProjects.ProjId = strLRTrim(conPeek(readCon,5));
        #                                    ledgerProjects.update();
        #                                }
        #                        }
        #                     }
        #                        //Record inserted count
        #                        inserted++;
        #                    }
        #
        #                }
        #            }
        #
        #            ttsCommit;
        #        }
        #
        #        icount--;//Remove header recount from total record count
        #    }
        #    catch(Exception::Error)
        #    {
        #       info(strFmt("%1",Exception::Error));
        #    }
        #
        #    info(strfmt("%1 records inserted out of %2",inserted,icount));
        #}

        #public container splitAccountNumAndDept(str _accountNumDept, str _separator = '-')
        #{
        #
        #    int     separatorPosition;
        #    container con;
        #
        #    ;
        #
        #        separatorPosition = strfind(_accountNumDept, _separator, strlen(_accountNumDept), -strlen(_accountNumDept));
        #
        #        if(separatorPosition)
        #        {
        #            //AccountNumber
        #            con = conIns(con, 1,substr(_accountNumDept, 1, separatorPosition - 1));
        #            //Department
        #            con = conIns(con, 2,substr(_accountNumDept, separatorPosition + 1, 3));
        #
        #        }
        #        else
        #        {
        #            //AccountNumber
        #            con = conIns(con, 1,_accountNumDept);
        #
        #        }
        #
        #    return con;
        #}

        #static void main(Args  args)
        #{
        #    LedgerImportNew        ledgerImportNew;
        #
        #    ;
        #
        #    ledgerImportNew =  new LedgerImportNew();
        #
        #    if(ledgerImportNew.prompt())
        #    {
        #        ledgerImportNew.run();
        #    }
        #

Thursday 25 June 2015

Dynamics Ax 2012 Interview Questions

1. Difference between following
condel :Use
condel to delete one or more items from a container.
confind :Use
confind to locate a sequence of items in a container.
conins :Use
conins to insert some items into a container.
conlen :Use
conlen to find out how many items there are in a container.
connull :Use
connull to explicitly dispose of the contents of a container.
conpeek :Use
conpeek to extract an item from a container, and to convert it into another data
type
conpoke :Use
conpoke to replace (poke) an item in a container.
2. Difference between edit and display method
Display Indicates that the method's return value is to be displayed on a form or a report.
The value cannot be altered in the form or report
Edit Indicates that the method's return type is to be used to provide information for a field that is
used in in a form. The value in the field can be edited.
3. Difference between perspectives and table collection
Perspectives can organize information for a report model in the Application Object Tree (AOT).
A perspective is a collection of tables. You use a report model to create reports.
Table collection is a collection of table, which sharing across all the virtual companies.
4. What are the 4 types of files we need to copy to the standard folder?
*.aod application
object data file
*.ahd Application
Online Help Data file
*.ald Application
Label data file.
*.add Application
Developer Documentation Data file
*.khd Kernel
Online Help Data
And other files are
*.ahi Application
Online Help Index files
*.adi Application
Developer Documentation Index files
*.ali Application
Label Index files
*.alt Application
Label Temporary file.
*.alc Application
Label Cache file
*. aoi Application
Object Index file
*.khd Kernel
Online Help Data
*.khi Kernel
Online Help Index files
5. Why we use virtual companies?
Virtual company accounts contain data in certain tables that are shared by any number of
company accounts. This allows users to post information in one company that will be available to
another company.
6. How can we restrict a class to be further extended?
using Final Keyword for ex: public final class <ClassName>
7. Which classes are used for data import export?
SysDataImport and SysDataExport
8. From which table u can get the user permissions stored in Ax?
AccessRightList table.
9. What should we do if we need last record to be active when a form is opened?
In properties of datasource table set the StartPosition property as last.
10. What is the sequence of events while a report is generated?
Init, Run, Prompt, Fetch, send,Print
11. Name few X++ classes/Coreclasses related to Queries?
Query, QueryRun, QueryBuildRange, QueryBuildDataSource, QueryBuildLink
12. What is an index?
An index is a tablespecific
database structure that speeds the retrieval of rows from the table.
Indexes are used to improve the performance of data retrieval and sometimes to ensure the
existence of unique records.
13. Define IntelliMorph
IntelliMorph is the technology that controls the user interface in Microsoft Dynamics AX. The user
interface is how the functionality of the application is presented or displayed to the
user.
IntelliMorph controls the layout of the user interface and makes it easier to modify forms, reports,
and menus.
14. Define MorphX
The MorphX Development Suite is the integrated development environment (IDE) in Microsoft
Dynamics AX used to develop and customize both the Windows interface and the Web interface.
15. Define X++
X++ is the objectoriented
programming language that is used in the MorphX environment .
16. Differentiate refresh(),reread(),research(),executequery()
refresh() will not reread the record from the database. It basically just refreshes the screen with
whatever is stored in the form cache.
reread() will only reread
the CURRENT record from the DB so you should not use it to refresh the
form data if you have added/removed records. It's often used if you change some values in the
current record in some code, and commit them to the database using .update() on the table,
instead of through the form datasource. In this case .reread() will make those changes appear on
the form.
research() will rerun the existing form query against the data source, therefore updating the list
with new/removed records as well as updating existing ones. This will honour any existing filters
and sorting on the form.
executeQuery() is another useful one. It should be used if you have modified the query in your
code and need to refresh the form. It's like
research() except it takes query changes into account.
17. Define AOT
The Application Object Tree (AOT) is a tree view of all the application objects within Microsoft
Dynamics AX. The AOT contains everything you need to customize the look and functionality of a
Microsoft Dynamics AX application
18. Define AOS
The Microsoft Dynamics AX Object Server (AOS) is the secondtier
application server in the
Microsoft Dynamics AX threetier
architecture.
The 3tier
environment is divided as follows:
• First Tier – Intelligent Client • Second Tier – AOS • Third Tier – Database Server
In a 3tier
solution the database runs on a server as the third tier; the AOS handles the business
logic in the second tier. The thin client is the first tier and handles the user interface and necessary
program logic.
19. Difference between temp table and container.
1. Data in containers are stored and retrieved sequentially, but a temporary table enables you to
define indexes to speed up data retrieval.
2. Containers provide slower data access if you are working with many records. However, if you
are working with only a few records, use a container.
3. Another important difference between temporary tables and containers is how they are used in
method calls. When you pass a temporary table into a method call, it is passed by reference.
Containers are passed by value. When a variable is passed by reference, only a pointer to the
object is passed into the method. When a variable is passed by value, a new copy of the variable is
passed into the method. If the computer has a limited amount of memory, it might start swapping
memory to disk, slowing down application execution. When you pass a variable into a method, a
temporary table may provide better performance than a container
20. .What is an EDT, Base Enum, how can we use array elements of an EDT?
EDT To
reuse its properties. The properties of many fields can change at one time by
changing the properties on the EDT. Relations can be assigned to an edt are known as Dynamic
relations.
EDT relations are Normal and Related field fixed.
Why not field fixed – field fixed works on only between two tables 11
relation. And Related field
fixed works on 1many
tables.so edt uses related field fixed.
BaseEnum which
is a list of literals. Enum values are represented internally as integers.
you can declare up to 251 (0 to 250) literals in a single enum type. To reference an enum in X++,
use the name of the enum, followed by the name of the literal, separated by two colons . ex NoYes::
No.
21. Definition and use of Maps, how AddressMap (with methods) is used in standard AX?
Maps define X++ elements that wrap table objects at run time. With a map, you associate a map
field with a field in one or more tables. This enables you to use the same field name to access fields
with different names in different tables. Map methods enable to you to create or modify methods
that act on the map fields.
Address map that contains an Address field. The Address map field is used to access both the
Address field in the CustTable table and the ToAddress field in the CustVendTransportPointLine
table
22. What is the difference between Index and Index hint?
Adding the "index" statement to an Axapta select, it does NOT mean that this index will be used
by
the database. What it DOES mean is that Axapta will send an "order by" to the database. Adding
the "index hint" statement to an Axapta select, it DOES mean that this index will be used by the
database (and no other one).
23. How many types of data validation methods are written on table level?
validateField(),validateWrite(),validateDelete(),aosvalidateDelete(),aosvalidateInsert(),
aosvalidateRead(),aosvalidateUpdate().
24. How many types of relations are available in Axapta, Explain each of them.
Normal Relation: enforce referential integrity such as foreign keys. For displaying lookup on the
child table.
Field fixed: works as a trigger to verify that a relation is active, if an enum field in the table has a
specific value then the relation is active. It works on conditional relations and works on enum type
of data.
ExDimension
table
Related field fixed: works as a filter on the related table.it only shows records that match the
specified value for an enum field on the related table.
25. When the recid is generated, what is its utility?
when the record is entered in the table the recid is generated by the kernel.it is unique for each
table.
26. Difference between Primary & Cluster index.
Primary index: It works on unique indexes. The data should be unique and not null. Retrieve data
from the database.
Clustered Index: It works on unique and non unique indexes.retrieve data from the AOS.
The advantages of having a cluster index are as follows:
Search results are quicker when records are retrieved by the cluster index, especially if
records are retrieved sequentially along the index.
Other indexes that use fields that are a part of the cluster index might use less data space.
Fewer files in the database; data is clustered in the same file as the clustering index. This
reduces the space used on the disk and in the cache.
The disadvantages of having a cluster index are as follows:
It takes longer to update records (but only when the fields in the clustering index are
changed).
More data space might be used for other indexes that use fields that are not part of the
cluster index if the clustering index is wider than approximately 20 characters).
27. How many kind of lookups can be made and how.
By using table relations
Using EDT relations.
Using morphx and using X++ code(Syslookup class).
28. How many types of Delete Actions are there in Standard Ax and define the use of each
None
Cascade
Restricted
Cascade+Restricted.
29. If any record is created in table I want to fetch the date & time stamp, how will you do that?
30. What is the function of super()
This method calls the system methods to execute.
It is used to instantiating the variables at the parent class. Used for code redundancy.
31. Utility and use of find method.
All the tables should have at least one find method that selects and returns one record
from the table that matches the unique index specified by the input parameters. The last input
parameter in a find method should be a Boolean variable called for update or update that is
defaulted to false. When it is set to true, the caller object can update the record that is returned by
the find method.
32. What are the different types of Table groups defined on table properties?
Miscellaneous
Parameter
Group
Main
Transaction
WorkSheetHeader
WorkSheetLine
33. Multiple inheritance possible or not, if not how can we overcome that.
In X++, a new class can only extend one other class; multiple inheritance is not supported. If you
extend a class, it inherits all the methods and variables in the parent class (the superclass).
We can use Interfaces instead of multiple inheritance in Ax.
34. Do we need to write main method, give reasons
Yes, but to open the class from action menu item we have to create main method of class.
35. What is difference between new & construct method
new(): used to create a memory to the object.
Construct(): You should create a static construct method for each class. The method should
return an instance of the class.
36. What is the utility of the RunOn property
Application objects such as reports, tables, and methods can run on the application object server
(AOS) or the client. An object can also have the RunOn property value set to Called from. Objects set
to Called from can run from either the client or server, depending on where the object is called
from. This topic describes the RunOn property, tiers that class objects can run on, and hints about
using AOSRunMode.
Default value of RunOn for Classes Called
from
MenuItems Client
37.What is main class used in batch process OR which class will you inherit to make a batch job
RunBaseBatch class
38. How can we make a batch job occur at regular interval Using
RunbaseBatch
39. What is the main utility of classes in standard Ax For
business logic
40. Which class is called when we create a SO/PO.
SalesFormLetter and PurchFormLetter
41. What is the basic structure of a form
Methods,DataSources,Design.
42. Properties of a form datasource
Name, Table, Index, AllowCheck, AllowEdit, AllowCreate, AllowDelete, StartPosition,JoinSource, LinkType.
43. validateWrite() method can be written in form datasource as well as table level, when should
we write it in form DS and when in table. Similar in case of write() method
when we want the validation at the table level means in every form where this table is uses, we
can write at the table level.
If we want validations at the particular form and it doesn’t effect to the other forms where this
table was used, then we can use form level validations.
44. How can we call table level methods from form DS (similar methods)
By creating the variable to the table and with tablevariable.methodname()
45. What is the difference between form init() & DS init()
Form init(): init is activated immediately after new and creates the runtime
image of the
form.
DS init(): Creates a data source query based on the data source properties.
The form data source init method creates the query to fetch data from the database and sets up
links if the form is linked to another form.
46. When a form opens what are the sequential methods called.
Form init(), DataSource init(), Form run(), DataSource executeQuery(), canClose(), close().
47. Where is the best place to write code to perform filter in a form
FormDataSource executeQuery()
and call this method in the design field of the form.
48. What are the different types of menu items available, explain each of them
Display – for Form
Output for
Report
Action for
classes.
49. Action type menu item is attached to a form but in the drop down the menu item is not
appearing, what could be the problem .
50. Difference between pass by reference and pass by value?
Pass By Reference:
In Pass by reference address of the variable is passed to a function. Whatever changes made to
the formal parameter will affect to the actual parameters
Same
memory location is used for both variables.(Formal and Actual)it
is useful when you required to return more than 1 values
Pass By Value:
In
this method value of the variable is passed. Changes made to formal will not affect the
actual parameters.
Different
memory locations will be created for both variables.
Here
there will be temporary variable created in the function stack which does not affect the
original variable.
In case of pass by value, the change in the subfunction
will not cause any change in the main
function whereas in pass by reference the change in the subfunction
will change the value in
the main function.
Pass by value sends a COPY of the data stored in the variable you specify, pass by reference
sends a direct link to the variable itself. So if you pass a variable by reference and then change
the variable inside the block you passed it into, the original variable will be changed. If you
simply pass by value, the original variable will not be able to be changed by the block you
passed it into but you will get a copy of whatever it contained at the time of the call.
51. What are the two most important methods on the Report?
Init(),run(),fetch(),send(),print()
52. When do block the super() method of fetch
Don't call super() when overriding the fetch method in a report
53. Can we make a report from wizard, if yes from where
Yes, Tools>DevelopmentTools>Wizards>Report Wizard
59. What is a Programmable Section, how we use it in reports
Use programmable sections to add any kind of customized information. To activate a
programmable section, activate it explicitly with an element.execute(Number) statement. The
Number must be specified in the ControlNumber property for the design section.
60. What is the difference between Auto Design Spec & Generated Design
Auto Design: An auto design is a report design that has a layout that is automatically generated
based on the data for the report. You can use auto designs for most common reports. Reusability
is available.
This uses Report template and Section template. Header ,Section Group and Footer is not
available.
Generate Design or Precision design: You can create a precision design for a report that requires a
very precise layout. It doesn’t use Section template and Report template. Reusability is not
available.
61. How can we sort the DS, what facility we can get in by placing fields in Ranges
this.query().datasource(1).addsortfield(fieldnum(tablename,fieldname),sorting:ascending);
62. What is the role of executeSection
You can override the executeSection method for a report section to modify the layout of the section
and to modify how the section is printed. If you want to do something before a section is printed,
such as go to the next page, this can be coded in the executeSection method.
63. What are Queries, how do we use them
You can create a query to retrieve data by using the query classes.
64. what is Composite query?
A composite query uses another query as its data source. A composite query is similar to class
inheritance in X++ or C#. A composite query is a good design choice when one of the following is
true:
An existing query lacks only a range that you want to add. An existing query lacks only a method
override that you want to add.
65. What is the use of Parameter, Enum Type Parameter/Enum Parameter properties of
MenuItems?
Parameters: Specify the arguments that are passed to the object. Optional.
Enum TypeParameter and Enum Parameter: Choose an enumerated type as a parameter for the
Object, and then select an enum value as the EnumParameter property. Optional.
These properties are typically used when one form is used in several different situations. You can
change the behavior of the form, depending on the EnumParameter value. For example, the
PriceDiscGroup form is used by three different display menu items (PriceDiscGroup_*), which
each have a different EnumParameter value. In the form's init method, a switch construct checks
the value, and then the form is created accordingly.
66. Why do we provide Configuration key & Security Key?
Configuration key: Configuration keys allow administrators to enable or disable features in the
application for all users. Disabling features helps to minimize the attack surface against potential
attacks.
Configuration keys are applied to:
Tables
Fields
Indexes
Views
Menus
Menu items
Form controls,
Report controls
Extended data types
Enumerations
Security key: Security keys allow administrators to set security on a user group level. Minimizing
access on a user group level helps to reduce the attack surface against potential attacks.
The main reasons to apply userlevel
security are to:
Allow users to do only their designated tasks.
Protect sensitive data in the database.
Prevent users from inadvertently breaking an application by changing code or objects on which
the application depends.
You need to apply a security key to:
Tables
Views
Menus
Menu items
Form controls
Report controls
67. Normally what do we attach in Output Forms
68. Normally what do we attach in Action Classes
69. What is difference between select & select firstonly statements
The select statement fetches or manipulates data from the database or both fetches and
manipulates data from the database. Results of a select statement are returned in a table buffer
variable.
If you are going to use only the first record or if only one record can be found, use
the firstOnlyqualifier. This optimizes the select statement for only one record. Do not
usewhile select firstOnly.
It is a best practice to use the firstOnly qualifier in find methods on tables.
70. What are the keywords used to access data from "multiple companies" and "one company to
another company".
A crosscompany
query returns data for several companies in a single run.
To create a crosscompany
query:
In X++, use the crossCompany keyword on the X++ select statement.
In X++, set the allowCrossCompany property method to true on an instance of the Query class.
In the AOT, set the AllowCrossCompany property to Yes on a node under Query.
71. How can we override a lookup
AOT>Form>DatasSource>Fields>FieldName >Lookup
Form>Design>Field>Lookup.
72. How do the following methods work in a form DS.
ds.refresh(), ds.research(), ds.reread(), in what situation we should use these methods
Refresh(): Updates the form by refreshing the view of all records in the data source.
Research(): Rereads the current record from the database.
Reread(): Refreshes the database search defined by the query, specified by
theFormDataSource.init method.
73. On closing a form name the methods which are invoked
Close(), closed(), finalise().
74. How can we provide user level/user group level security By
using security keys.
75. What is Visual MorphXplorer, what do we do with that?(Reverse engineering tool has replaced
Visual
MorphXplorer)
76. What is the function of Application Hierarchy Tree?
Displays the current object's inheritance hierarchy.
The Application Hierarchy Tree enables you to view information about the parents and children of
application objects. For example, you can see all the classes that extend a particular class, or see
which data types a particular extended data type inherits from. It also enables you to view the
methods, fields, and indexes that are used by tables. Information is available for application and
system classes, tables, and data types.
To view information for a single application object
Rightclick
the object, and then select AddIns
> Application Hierarchy Tree.
To view information for all application objects
Select Tools > Development tools > Application Hierarchy Tree.
You need to generate crossreferences
before you can use the Application Hierarchy Tree.
Tables are listed under the Common node in the Application Hierarchy Tree. All tables extend the
system table called Common. Classes are listed under the Object node.
77. If you want to monitor the database activity, where can you get that?
Administration>Reports>DataBase information
Administration>inquiries> DataBase information
Administration>Reports>Size of Company accounts
78. Where can we find the Label log and what is its utility?
Tools>DevelopmentTools>Label>Label log.
Use this form to view the history of labels within the system and recreate
labels that have been
deleted.
View a record of all changes made to the label files.
Overview Each label is described in terms of its identification (ID), language,
status, label text, and by whom and when it was modified. A label can also
contain a description, which is displayed at the bottom of the form.
General View information about the selected label.
Button
Recreate Recreate
the selected label.
79. What is Label Intervals?
The SysLabelInterval table contains the settings that control the interval of label IDs that are used
to create new labels through the label editor in MorphX.
80. What are the tools you will use to upgrade any object? Compare
81. What is the use of System Documentation/Application Developer Documentation/Application
Documentation
System Documentation is intended for developers under the functions subnode there are hundreds
of useful functions you will use when programming in x++.
Application Developer Documentation, under this node you find documentation about tables
and classes used by Ax. description about tables and classes for developers.
82. What are the classes, Tables, Forms and Methods used to post the sales orders.
SalesTableType and SaleslineType classes will get called while creating the orders.
SalesFormLetter* classes will be used to post the sales order at various document status(packing,
invoice etc).
SalesParm* tables are used to prepare the data for posting
CustConfirmJour, CustConfirmTrans when
a sales order gets confirmed
CustPackingSlipJour, CustPackingSlipTrans when
a packing slip is posted.
CustInvoiceTable,CustInvoiceTrans when
an invoice is posted.
These are some of the maily used tables.
83. What are the classes, Tables, Forms and Methods used to post the purchase orders.
84. What are the classes, Tables, Forms and Methods used to post the Ledgers.
85. What are the classes, Tables, Forms and Methods used to post the Inventory.
86. What is the base class to send the onboad
Emailing.
SysMailer and SysINetMail.
87. What are the storage Dimensions?
Site,WareHouse,PalletId,BatchNumber,SerialNumber
88. What are the Item Dimensions?
Configuration, size,Color
89. What is the difference between RunBase and RunBaseBatch?
RunBase: To create a job or an Action class a
program that carries out processes, such as
accepting parameters from the user and then updating records in the database you
use the
RunBase framework.
The framework is implemented by the RunBase application class and supplies many features,
which include the following:
Query
Dialog, with persistence of the last values entered by the user
Validate
The RunBase class is a framework for classes that need a dialog for user interaction and that need
the dialog values to be saved per user.
RunBaseBatch: You can design your own batch job by extending the RunBaseBatch class. You can
also write code to schedule the batch to run. The batch runs on the Application Object Server
(AOS)
91. What is the difference between Insert and doinsert.
Insert(): To insert the records into the database. Secure any related transactions with tts.
Doinsert():These methods should only be used under strict control because they bypass the
following:
Any validations that have been set up.
Any code that was written in the insert, update, and delete methods.
92. What is the Runbase Stack?
93. Difference between sql and x++ statementSELECT1.
Table buffer on the FROM in x++ clause ,not the table as in SQL
2.ORDER BY clause precedes the WHERE clause
3.! for negation ,not NOT as in SQL
4.&& and || for logical operator ,not AND or OR as in SQL.
5.* and ? for like wildcards ,not % and _ as in SQL.
JOIN CLAUSE1.
Join clause has no ON keyword in x++,use WHERE instead
2.Default JOIN direction is left .
3.there are no LEFT and RIGHT keyword for JOIN in x++
4.The FROM clause is optional when:
No
column is listed or
Only
one table is listed in the SELECT in x++
select * FROM CustTable;
select CustTable; both are same.
OTHERS1.
The WHILE SELECT statement provides an automatic cursor for return rows in x++
2.There is no HAVING keyword in x++
3.No null values are return in x++
94. What is cluster installation?
Admin Setup
Cluster
Configuration
Click System administration > Setup > System > Cluster configuration.
You can distribute the user load in Microsoft Dynamics AX across multiple instances of
Application Object Server (AOS) by creating a load balancing cluster.
95. Steps in creating number sequence?
Basic>Setup>NumberSequences> NumberSequences – Create a new number sequence.
Classes>NumberSequenceReference>LoadModule.
AR>Setup>parameters setup
code.
Tables>CustParameters create
method starts with numRefEDT.
Form>FormRun Create
numberSequenceFormHandler method.
Form>FormDataSource Override
create method.
96. Any module you are good at. – AR,AP,Inventory,Production.
97. Collection classes
You cannot store objects in arrays or containers. The AX collection classes have been designed for
storing objects. The classes are implemented in C++ to achieve the maximum performance (they
are system classes).
Class Description
Array
Similar to the array type except that it can hold values of any single
type, including objects and records. Objects are accessed in a specific
order.
List Contains elements that are accessed sequentially.
Map Associates a key value with another value.
Set Holds values of any single type; used when order is important.
Struct
Can contain values of more than one type. Used to group information
about a specific entity.
98. Tables in inventory?
InvetTable,InventTableModule,InventItemLocation, InventDim, InventTrans
BOMTable , WMSShipment.InventColor, InventSize
99. If you manipulate anything which layer would it affect?
The present layer where you are working and below of that layer.
100. What are the components in reports?
Methods , DataSources , Design.
101. How many types of classes are there?
System Classes and Application Classes.
102. Development tools?
Version control , Crossreference,
Code profiler, Debugger, Application Hierarchy Tree,Code
Explorer, Reverse Engineer, Number of Records, Embedded Resources, Wizards, Label.
103. Communication tools
104. Can you say few best practises in ax?
105. What is the difference between sql queries and dynamics queries.
Sql query is Select statement –
Dynamic query – AOT Query and Query class using x++.
106. What is the difference between x++ and c#?
X++ contains code and Sql select statements
C# contains only code.
107. What are the link types in Ax?
Passive: Linked child data sources are not updated automatically. Updates of the child data source
must be programmed on the active method of the master data source.
Delayed: A pause is inserted before linked child data sources are updated. This enables faster
navigation in the parent data source because the records from child data sources are not updated
immediately. For example, the user could be scrolling past several orders without immediately
seeing each order lines.
Active: The child data source is updated immediately when a new record in the parent data source
is selected. Continuous updates consume lots of resources.
InnerJoin: Selects records from the main table that have matching records in the joined table and
vice versa. There is one record for each match. Records without related records in the other data
source are eliminated from the result.
OuterJoin: Selects records from the main table whether they have matching records in the joined
table.
And the other records also shown in the main table.
ExistJoin: Selects a record from the main table for each matching record in the joined table.
The differences between InnerJoin and ExistJoin are as follows:
When
the join type is ExistJoin, the search ends after the first match has been found.
When
the join type is InnerJoin, all matching records are searched for.
NotExistJoin: Select records from the main table that do not have a match in the joined table.
108. What can’t you store in containers
We can’t store objects in containers.
109. Difference between arrays and containers
An array can hold only items of same and its declared type. Containers store different types of data
types at a time.
You can allocate memory space for an array and fill that space with values later, such as in a loop.
This is efficient and performs well.
110. Logic for converting string to uppercase?
StrUpr() Converts
all the letters in a string to uppercase.
111.What is JumpRef()?
The user activates the Go to main table command from the shortcut menu on the control or by
pressing CTRL+ALT+F4. The super() call opens the main table that contains data for the field.
112. D.B Abstract and final class.
Abstract forces the class to be derive subclass and final stops the class not to be derive or
inheritance.
113. D.B ValidateWrite and write.
validateWrite(): Executed when a new or updated record is to be written. Determines whether
data is valid and ready to be written.
Write(): Executed when the user inserts a new record or updates an existing one. Calls
theFormDataSource.validateWrite method and manages the database write operation.
114. What is dialoge class.
A dialog in AX is a simple form with a standardized layout, created by using the Dialog system
class. Dialogs should allow users to enter some simple values.
Dialog ClassesDialogField,
DialogGroup, DialogTabPage, DialogText, DialogWindow.
Dialog Methods – addField,addGroup,addTabPage,run,pack,unpack,
115. Pack and Unpack method?
Use the packunpack
pattern to save and/or store the state of an object, and then later reinstantiate
the same object.
Pack():create a pack method to read the state of the object and return it in a container suitable for
saving or transporting between tiers. Reading the state of the object implies collecting the value of
all its members. If the members are tables (records, cursors, temporary tables) or classes, it must
also be possible to read their state.
Returns the state of the object as a container.
Unpack():create an unpack method that takes the packed state and reinitializes an object with it.
Construct the object before creating an unpack method.
The unpack method takes the saved state of the object and reinitializes the object with it. It
reinitializes the object members according to the values in the container, taking the supplied
version number into account.
The method can return a Boolean that signals the result of the initialization process.
116. Architecture of MS dynamics AX.
Ax has the three tier architecture 1
. client 2. AOS 3.DataBase.
117. Tell us about AIF(MSMQ).
Application Integration Framework (AIF) is the infrastructure within AX with which you can
expose business logic or exchange data with other systems. AIF is comprised of three primary
components:
1.Services Enable
you to expose business logic written in X++ as a service to be consumed by
other applications. Within Microsoft Dynamics AX, you can create, customize, and publish
services.
2.Document services A
specific implementation of services in which the Microsoft Dynamics AX
business logic is exposed through document services.
3.Consume Web services In
Microsoft Dynamics AX, you can consume external Web services
from your X++ code.
118. How to design a form in AX using X++?
The Form* classes enable you to manipulate, create, modify, or run forms by using X++ code. You
can also modify forms during run time so, for example, one or more controls are hidden on a form,
depending on the user's selections in the preceding form.
The Form classes are all system classes and are prefixed with Form.
Form, FormRun, FormDesign, FormBuildDesign, FormDataSource, FormBuildDataSource,
FormControl
119. What is report builder?
You can create reports by using Report Builder for Microsoft SQL Server Reporting Services. You
add information to the report from a report model.
When you create a report by using Report Builder for Microsoft SQL Server Reporting Services,
you are using secure views of the tables available in the report model.
120. What is Index, properties in Index and types of Index?
An index is a tablespecific
database structure that speeds the retrieval of rows from a table.
Indexes are used to improve the performance of data retrieval and to ensure the existence of
unique records. It's up to the databasespecific
query optimizer to use available indexes to
facilitate efficient data retrieval.
Unique index and nonunique
index.
121. Concept of Different Layer in AX.
sys syp gls Glp hfx sl1 sl2 sl3 bus bup var vap cus cup usr usp
122. Difference between bound and unbound controls?
Form controls belong to one of three groups, depending on their data source as follows:
Bound control – associated with a field in an underlying table. Use bound controls to
display, enter, and update values from fields in the database.
Unbound control – does not have a data source. Use unbound controls to display pictures
and static text.
Calculated controls – uses a method as the data source. An example of a calculated control
is the sum of two fields on a form.
123. How to create runtime query?
You can create a query to retrieve data by using the query classes.
Query, QueryRun, QueryBuildDataSource, QueryBuildRange, QueryBuildLink,
QueryBuildDynaLink
124. What is optimistic concurrency control and Pessimistic Concurrency Control?
Optimistic Concurrency Control (OCC) helps increase database performance. Pessimistic
Concurrency Control locks records as soon as they are fetched from the database for an update.
However, Optimistic Concurrency only locks records from the time when the actual update is
performed.
Following are the advantages of using OCC:
Fewer resources are used to hold the locks during the update process.
Records are locked for a shorter length of time.
Records remain available for other processes to update if they have been selected from the
database but haven't yet been updated.
The disadvantage of using OCC is that the update can fail if another process updates the same
record. If the update fails, it must be retried. This can lead to a reduction in database
performance.
OCC makes it possible for other processes to update a record even after it has been fetched. You
can catch update conflicts by catching
the UpdateConflict and UpdateConflictNotRecoveredexceptions.
125. What are transactions?
126. How to lock transactions?
127. What are macros?
Macros act as a container for defining variables used for frequent tasks. The purpose of
macros is to make statements easy to reuse. A macro can’t be executed independently as a class.
An advantage macro is that the maintenance is done in only one place.
Three types of macros
Macro libraries – is a standalone macro that contains a collection of local macros.
Standalone macros – is created by using the macro node in the AOT.
Local macros is
declared with in a method.
128. What is the default link type property? Delayed.
129. Default join in select statement (Queries) innerJoin
130. Difference between validate write and validate field?
validateWrite(): Executed when a record is written to the database, before the data change is
committed in the database.
validateField():Executed when you leave a field in a record. For example, after entering changes to
a field on a grid control, you could click another field in that same record or on a different record.
Or you could click another control on that same form.
The super() method invokes field validation checks, as guided by the value of
the Validateproperty.
131. Do we have validate write and validate field in form level?
FormDataSource – validateWrite()
FormDataSourceField validate()
132. What are the methods required for posting a purchase order?
133. How to give null in select query?
Select table where table.field == “ ” ;
134. What is cache lookup and IsLookup what is it used for?
CacheLookup : Determines how to cache the records retrieved during a lookup operation.
Types None
, NotInTTS, Found, FoundAndEmpty,EntireTable.
IsLookup : For report models, it specifies whether the table information is incorporated into other
tables that reference it when a report model is generated.
For OLAP cubes, it determines whether to generate a consolidated dimension or a distinct
dimension. You can specify one of the following values.
Yes Indicates
that attributes from the table are to be consolidated into the parent
dimension (star schema).
No Indicates
that a separate dimension is to be generated for the table (snowflake
schema).
135. Difference between table and views?
A Microsoft Dynamics AX view is a virtual table that contains the data records and fields that are
specified by a query.Like a table, a view uses fields and rows to represent data records. However,
the data in a view is not stored as a database object but is dynamically created when the view is
accessed. A view uses a query to retrieve data fields from one or more database tables.
When you create a view, the view definition is generated and stored in the database. When that
view is accessed, the view dynamically retrieves the data that satisfies the view definition.
Views are readonly.
The data fields and tables that a view uses cannot be updated from that view.
Benefit Description
Focused data
A view enables you to retrieve and return only the data that is relevant
for a particular user or scenario.
Customized data
A view enables you use a complex query to create a highlycustomized
set of data. For example, a view often represents data as a single table
that was retrieved from multiple joined tables and used many
conditions.
Performance
A view can improve performance by returning only relevant fields to
the user. In addition, a view definition is compiled which may provide
better performance than calling an equivalently complex query.
136. In which case delete_from and delete() have same result?
When deleting only one record in the table.
137. Explain sales/purchase order processes in AX.
138. Can you just tell the table properties that you can remember?
139. Explain different types of reports?
AOT Reports , Using X++ Report
classes, Using Report wizard.
140. Primary Key in tables (In dynamics AX don’t have primary key)
141. What is the default index for a table?
The system index is created on the RecId and DataAreaId fields if the DataAreaId field exists.
Otherwise the system index is created on the RecId field. You can see system indexes in the
database but they aren't visible in the AOT.
142. What are all the addon
tools you used in Dynamics AX (It’s an indirect question for AIF)
143. Did you work with EP (Enterprise Portal & Workflow) how can you implement this features
into your projects?
144. Difference between this and element?
this & element: this can be used in any objects to reference the current object and member
methods.
In forms the collection of objects is contained within a FormRun object. You can reference
members in the outer formrun object by using the element reference.
If your code is placed at the top level there are no functional difference between this and element.
If your code is placed in a formdatasource but this will reference the datasource but element will
reference the formrun.
You cannot use element to refer table or class object.
145. COM & .NET Business Connector
146. Concurrent user & Named user
147. Primary key & Foreign key
148. AOS Load balancer concept/Clustering
149. AX 2009 Debugger concepts?
Use this debugger to debug X++ code that is running on the following:
Microsoft Dynamics AX Business Connector
AOS
Microsoft Dynamics AX Client
The debugger windows. 1. Code 2. Variables 3.Call stack 4.Watch 5.Break
points
6. Output
150. Cross reference tool ?
The Microsoft Dynamics AX crossreference
system allows you to see the relationships between
objects. You can see the following:
Which other objects use the current object
Which other objects the current object uses
For example, you can get a list of every piece of code that uses a particular method, or you can see
which forms use a particular table field. You can also get information about where labels are used
in the application.
151. Document Management
152. Print Management
153. Caching mechanism in AX ?
Caching is to remember the information already retrieved from the database and use this
memory when the same data is needed again.
Drawback, if the remembered information is no longer valid this could compromise the
consistency of the database as the updates are made based on the invalid data.
Read ahead caching , single record caching, Entire table caching, Record view caching, Display
method caching.
154. What is cloud computing? How it is configured in AX?
155. Difference between parameter table and Normal table?
The parameter system design pattern holds static setup information for the modules in a
company, such as information on the national currency, the posting method, and so on. There is
one instantiation of this pattern per module.
The parameter system should be set up as described in this topic. The parameter record is
automatically created by the system and has the following:
A parameter table
A parameter form
A parameter menu item
There should be one parameter table per module.
Parameter tables have a single record per company, holding the required parameters for the
module. The record is cached. To enable the Foundcache,
a key is defined.
Add an integer field called key. It should have the Visible property set to No
156. What is Configuration form in Ax?
Administration>Setup>System>Configuration displays
all the module configuration
keys and we can enable or disable the key from this form.
157. How to change Standard table as temporary table ?
By changing the table property to Yes and Use the setTmp table method to make a nontemporary
table temporary rather than creating a copy of the table, and then making it temporary.
158. What is difference between Auto design and Generate design ? If we uses both designs in a
report what design will be print?
Report prints Generated
design.
159. Oops concept what doesn’t support in Ax?
Multiple inheritance and method overloading
160. Instead of multiple inheritance what we use in Ax?
Interfaces
161. How to open exe file in Ax?
Ax32.exe "
C:\Program Files\Microsoft Dynamics AX\50\Client\Bin\Ax32.exe"
162. What is table properties of formRef and ReportRef ?
For tables where the Table Group property has been set to Group, Main, or
WorksheetHeader, you must do the following:
Have a form to maintain the table records.
Set the FormRef property to the name of a display menu item.
The form and the display menu item that are used to start the form should have the same
name as the table. An example of this rule is the CustTable table in Microsoft Dynamics AX.
Note
Don't set the FormRef property for tables where the MaxAccessMode property is set to
NoAccess. These tables are not used in a form.
Specifies the display menu item that is activated when a table is referenced.
When you use a primary index field on a report, this form is available as a link in the
report. A primary index is specified by using the PrimaryIndex property.
If you leave this field blank, the system attempts to display a form that has the same name
as the table.
The FormRef property of a table lookups display menuitems.
163. How many types of exceptions are there in Ax?
15 types of exceptions in Ax are Info,
warning,deadlock,error,internal,break,dderror,sequence,numeric,CLR error,Code access
security,UpdateConflict,UpdateConflictNotRecovered,DuplicateKeyException,DuplicateKeyExceptionNot
Recovered.
164. Access modifiers and Method modifiers ?
Access Modifiers: All methods of a class are always available to code in the class itself. To control
access from other classes, and to control inheritance by subclasses, X++ has three access control
modifiers for methods:
Classes are treated as public if you do not specify an access modifier.
public : Methods that are declared as public can be used anywhere the class is accessible and can
be overridden by subclasses.
protected : Methods that are declared as protected can only be called from methods in the class
and in subclasses of the class where the protected method is declared.
private : Methods that are declared as private can only be called from methods in the class where
the private method is declared.
Method Modifiers : abstract ,client,server,display,edit,final,static,public,private,
protected.
165. How many types of dimensions in inventory?
Item dimensions – Configuration,size,color
Storage dimensions – Site, Ware house, PalletId, Batch number, Serial Number.
166. If we create table relation and EDT relation for the same field in the table which relation the
field uses?
Table relation.
167. What is Composite query where we can use?
A query with in another query is called Composite query. Uses in the Query node in the
AOT.
168. Can run the form on server side? No
169. Difference between table delete and form delete?
170. What is section template and report template?
Report Template: A report template can specify the sections that a report includes, such as a page
header and a page footer, page numbers on each page ,company logo ,the controls included in each
section, and the layout of the controls. Only reports based on an Auto design inherit changes that
are made to a report template, Generate design doesn’t inherit changes to report template.
Section template: This makes it possible to define sections one time and reuse them many times.
This is used for elements appearing in more than one report.
171. When you are creating a table what is the default table group? Miscellaneous
172. Where is the best place to write the logic in Ax?
Classes, try to avoid the code in the forms.
173. what is the thin and thick or fat client in the configurations?
Thick client has the direct access to the database.
How to generate the Sales invoice periodically/automatically?
How to send the customer’s report as an Email
to the particular users on daily status?
What class will call when sending the Email?
How to run the debug for the server modifier methods?
What are the delete actions?
What are the relations and examples?
What is Security key and configuration key?
What are the query methods and what is get , getno methods?
In the fetch method of report we call get() and getno() methods. Get is used to get the table from
the query or datasource of report, here we will give the datasource table name. and getno() is used
to get the query number or datasource table number of a report.
What is the Sales order cycle?
10. What methods and tables called when posting the sales order?
11. What is purchase requisition?
12. What is BOM?
13. What is abstract class? what are the abstract classes in Ax?
RunBase, RunBaseBatch, FormLetter , FormLetterReport
, PurchFormLetter,PurchFormLetterReport, SalesFormLetter, SalesFormLetterReport,RunBaseReport,GanttData
,InventModelType , InventMovement LedgerBalance PrintMgmtHierarchy , PrintMgmtNode
,PrintMgmtSetupSettings , SmmImport SmmOutlookSync , SysCheckList , SysCodeExplorer
,SysDataExpImp , SysDefaultData, SysExcel, SysExcelApplication , SysExcelCell
,SysExcelWorkbooks , SysExcelRange , SysSearch, SysWizard, WorkflowElement,
AddressSelectForm, AddressZipCodeImport, AifDocument, AifDocumentService, AssetSumCalc,AssetTableInterval, AssetTableMethod, AxdBase, Barcode, BOMCalcBase,
BomCalcLine, BOMCopyFrom, CustVendBalanceList, CustVendPaym, CustVendTransData,DimensionCopy
14. What is interface and what are interfaces classes in Ax?
Batchable, SysPackable, SysComparable, SysMergeable,SysSaveable
,AfService,SysVersionControllable, SysTestExecutable, SysTestListener
,AifXmlSerializable,AifCustomizableService, AifGatewayReceiveManager, AifGatewaySendManager,
AifIntegrationAdapter, AifPipelineComponentInterface,AfEmployeeService,WorkflowDueDateProvider,WorkflowHierarchyProviderNode,
WorkflowConfigControl, WMSOrderTransMultiUpdateHandleable, DynamicPropertyCallback,RunbaseRecsMapable, SysCompareContextProvider, WorkflowStartedEventHandler,
WorkflowCompletedEventHandler,
WorkflowCanceledEventHandler,SysVisioModelProvider, SysVersionControlChangeLists,
SysVersionControlReviews, , SysTaskRecorderIEventMonitor, SysImportStatusGettable,SysImportLoggable, SysCheckListInterfaceUpgrade, ButtonStateProvider
15. What is polymorphism?
16. What is primary index ,clustered index?
17. Write a program for reversing the string?
18. Why SSRS using temporary table, can we use normal table?
19. How many types we can develop SSRS reports?
20. What is Data provider class?
21. What is the best way to develop SSRS reports? (query or DP class)
22. Write a program to print the sum of amount for each accountnum from CustTrans?
23. Write a program to print the reverse of a given number?
24. Write a program for finding the biggest element in the array?
25. What are changes between Ax2009 and Ax2012?
26. What is table inheritance in Ax 2012?
27. What is table reference in EDT – 2012?
28. What is surrogate key in Ax 2012 ?
29. How to cancel the sales order from X++, what is the best place to write the code for cancelation?
30. If I have millions of records in a form and to open the form or perform any operation it is taking
more time. So how to speed up the process of the form to retrieve the records from the database?
31. What is FIFO and LIFO in inventory ,give the real time example?
32. How to debug the batch jobs in ax?
33. What is amstrong number write a program for finding the amstrong number?
34. Where you will write the code for filter in form and report?
35. Differences between abstract class and interfaces?
1. Main difference is methods of a Java interface are implicitly abstract and cannot have
implementations. A Java abstract class can have instance methods that implements a default
behavior.
2. Variables declared in a Java interface is by default final. An abstract class may contain nonfinal
variables.
3. Members of a Java interface are public by default. A Java abstract class can have the usual flavors
of class members like private, protected, etc..
4. Java interface should be implemented using keyword “implements”; A Java abstract class should
be extended using keyword “extends”.
5. An interface can extend another Java interface only, an abstract class can extend another Java
class and implement multiple Java interfaces.
6. A Java class can implement multiple interfaces but it can extend only one abstract class.
7. Interface is absolutely abstract and cannot be instantiated; A Java abstract class also cannot be
instantiated, but can be invoked if a main() exists.
8. In comparison with java abstract classes, java interfaces are slow as it requires extra indirection.
Interview Questions:
Tell about your Self.
What kind of Customizations you have done.
How you will create Table in Ax. In that Table how you will define Indexes, Relations, Delete
Actions and Methods. Tell me the steps First what you will do, First you will define Indexes or
Relations. Why?
What is Naming Conventions in Ax?
What is Index? How many types of Indexes are there? What is unique index and nonunique?
What is Cluster Index?
What is Cache Look Up? More Questions on regarding Cache Look Up?
What is FormRef?
What is Configuration Key? Why need of configuration keys?
10) What is Security Key?
11) What is Record Level Security?
12) How the ax is providing security. What are the ways?
13) Types of Relations.
14) Types of Delete Actions.
15) What kind of methods you will create will create a Particular Table?
16) What is Table Collections?
17) How you will create different Environments like Aos1, Aos2……………..so on……
18) For Example: 150 users are Accessing Aos1.How you will assign users to Aos2 for that what you
required. More Questions on regarding AOS
19) Tell me the Invent Table Form Data sources?
20) Invent Dim Table What it stores?
21) What is Table Group? When you creating new tables in ax by default what is the Table Group?
22) Can you tell me the Sales Table, Table Group? What it consists
23) How you will do the SSRS Repots in AX?
24) What are all the New Features are added in Ax 2009?
25) How to install Ax 2009? What it Require? How you will install in Win XP & Vista? More
Questions on regarding Ax Installation.
26) What is Workflow? How you will do this? Ex: For Po how to configure Workflow? Steps…..
27) For New Module how to Achieve Workflow. Steps. more Questions on regarding WF
28) How you will configure Workflow For AR
29) How to install Workflow. What it requires (software’s).
30) Weather Workflow requires EP?
31) What is EP? What it requires (software’s). More Questions on regarding EP.
32) What is Number Sequence? How you will do that? Number Sequence Steps…
33) How you configure Number Sequence in Ax? For Example I created one record in ABC Form. I
didn’t save the record. I just deleted the record. In that Case what will happen? What comes next….
34) What is Global Address Book?
35) How can you use the Global Address Book?
36) How can you Create New Employee?
37) What is the use of Virtual Companies?
38) At form Level how you will define Query Build Classes. How you will do that
39) Tell me Form Level Data Source Methods.
40) What is Execute Query
41) What is Init at form Methods
42) Types of Inventory Dimensions?
43) Types of Item Dimensions?
44) Types of Storage Dimensions?
45) Types of Dimensions in Ax?
46) How to define Composite Queries in Ax?
47) Number Sequence Classes.
48) Types of Link Types?
49) Inner Join and Exists Join?
50) Oops Concepts?
51) What is inheritance?
52) Types of Inheritance?
53) What is Abstract Class in Ax? How you will define?
54) What is interface?
55) Tell me Interfaces Classes in Ax?
56) What is RunBase?
57) Where we can create item in Ax2012?
58) Difference between change company and cross company?
59) What is surrogatekey in 2012?
60) How to import data one application to another application?

61) Differences in 2009 and 2012?