Saturday, 30 January 2016

Error 1053: The service did not respond to the start or control request in a timely fashion in ax 2012 R3

When you start the service u will get one dialog box in that 

Windows could not start the Microsoft Dynamics AX Object Server 6.3$01-MicrosoftDynamicsAX service on Local Computer.

Error 1053: The service did not respond to the start or control request in a timely fashion.

1.There is a standard timeout for starting services. It expects to be started then. Can you confirm if the AOS is started anyway?
2.When you try to start the service manual and don't close the dialog box, you will get the same error. When you click OK, you will notice that the service is in Starting state.
3.It takes some more time, but in the end the AOS should be up and running

Ax 2012 R3 demo data & Test data Transfer Tool download

The contoso demo data for Dynamics Ax 2012 R3 is different from previous version.we used .dat file to load demo data in previous versions. Demo data is available in .exe file.
i.e DynamicsAX2012R3DemoData.exe available in partner Resource.

 Download Ax 2012 R3 demo data


To import this demo data we need  Test Data transfer Tool is available on partner resource.

Go on following link

To import demo data we need to do the following steps.

Step 1:
  • Extract the demo data files from DynamicsAX2012R3DemoData.exe to a specific location.
Step1
  • The output folder will contain the files of following extension types:
  1. .OUT—– data file that contains metadata for AX transactional database
  2. .OutModel —- data file that contain metadata for AX model database
  3. .XML —- data file that contains AX table data.
Step 2:
 Run the Test Data Transfer Tool.Exe file to install the utility.
zb2
  • After successful installation, the folder will look like as shown below:
zb3
Step 3 :
  • Open AX client and import the .XPO named (MetaDataXMLGenerator.Xpo)
zb4
  • On successful import a job will be created as shown below:
zb5
Step 4:
  • Run the job <MetadataXMLGenerator(usr)>, a  meta data file will be generated and the path will be displayed in the infolog as shown in the snapshot below:
zb6
Step 5:
Copy the metadata file from the above path and paste it in [lists] folder (where Test Data Transfer Tool has been extracted). If the file already exists, then overwrite the file.

Step 6 :
Stop MS Dynamics AX service.

Step 7 :
Open command prompt using administrator and navigate to the path where the Test Data Transfer Tool is extracted).

Step 8:
  • Run the following command:
Dp.exe Import “C:\R3DemoData\DynamicsAXR3DemoData” DynamicsAXR3
C:\R3DemoData\DynamicsAXR3DemoData—— update the path (Demo Data extraced path)
DynamicsAXR3—— provide the actual database name.(Ax DB Name)
In case of 3 tier environment, you will get the following screen.





[Server] always looking for current machine.if DB in another server follow step 9. 
Step 9 : you need to install Test data transfer tool on SQL server and run DP command on same server. 
in case of standalone you will get the following screen.
zb7
If we enter ‘Y’, then following screen will open up describing the count for importing the table data and Error (if they come up)
zb8
  • The process may prolong depending upon machine configuration.
  • On successful import, Open AX client and data will show up.

-----------------------------------------------------------------------

Note: Some time system will show below error

“Unhandled Exception: System.UnauthorizedAccessException: Access to the path ‘C:\Program Files (x86)\Microsoft Dynamics AX 2012 Test Data Transfer Tool (Beta)\DP Log.xml’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync)
at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName)
at System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options)
at DP.Program.Execute(String currentDirectory, DataportDirection direction, S
tring directory, String database, String server, DataportAction action) in e:\bt
\110700\Source\DataPort\DP\Program.cs:line 182
at DP.Program.Main(String[] args) in e:\bt\110700\Source\DataPort\DP\Program.
cs:line 82


If you are facing the same error than try to run following command (Its same command as above without “ ”)
DP.exe IMPORT C:\AXR3DemoData AX2012R3DB
Now it will work J
As next, Below window will open
clip_image017
Here you done your part, now wait to complete this operation and open your AX client.

Tuesday, 12 January 2016




IMPORT CUSTOMER MASTER DATA THROUGH DATA IMPORT EXPORT FRAMEWORK IN AX 2012


Importing Customer Master Data through Data Import Export Framework in AX 2012 R3
The Microsoft Dynamics AX 2012 Data Import/Export Framework helps you import and export data in AX which include master data, open stock, and balances.
  • For Microsoft Dynamics AX 2012 R3, Data Import/Export Framework is included in the release.
  • For Microsoft Dynamics AX 2012 R2, Data Import/Export Framework is available in cumulative update 7 for Microsoft Dynamics AX 2012 R2.
  • For AX 2012 or Microsoft Dynamics AX 2012 Feature Pack, Data Import/Export Framework is available from Information Source-download.

Step 1: Define Parameters
Navigation: Data import export framework > Setup > Data import/export framework parameters
  • Create a folder in your directory
  • Browse the location for the folder which is created
  • Validate the directory, it will show the Green check box

1
Step 2: Pre-defined Entities in AX
AX has some of the pre-defined entities inbuilt in the application of which we will use one of them.
Navigation: Data import export framework > Setup > Target Entities
2
Step 3: Create Source Data formats
Navigation: Data import export framework > Setup > Source Data formats
Determine the source of the data to export or import, and create a source data format for the data. For export, the source is AX. For import, you can use any of the following sources:
  • AX– Import data from another Microsoft Dynamics AX instance.
  • ODBC– Import data from another database, such as Microsoft SQL Server or Microsoft Access.
  • File– Import data from a fixed-width or delimited text file, XML file, or Microsoft Excel file.

  • Source as “Comma”
  • Enter a description for it as “Comma separated file”
  • Type – select the type as “File”
  • In the General area on the right side of the form select
    • Column delimiter as “comma (,)”
3
Once the above setups are done we will now start creating target entities for which we want to upload the data in AX
Step 4: Create Processing group
Navigation: Data import export framework > Common > Processing group
  • Click on New on to create a new group
  • Enter group name as Customer
  • Enter a suitable description
  • Then click on Entities to get the required fields and move on to next step
4
Step 5: Select entities for processing
Once you click on Entities in the above step it will open a new form wherein we need to create
  • Click on New button
  • Select the Entity as “Customer” from the drop down
  • Select the Source data format as “comma” create in Step 3
  • Then click on the Generate source file to select the required fields
5
Step 6: Generate Source file
Once you click on Generate source file a new wizard will be generated to create a template
  • Click on Next
6
Step 7: Select the required fields to upload the Customer master
  • Select the Field name which are required to upload
  • By default some of the mandatory fields such as AccountNum, CountryRegionid, CustGroup, Currency are selected
  • Apart from them you can select some other fields such as Name, Address, Language id etc.
  • Then click on Generate Sample File to generate a notepad for the selected fields with comma delimited
  • Click on Finish button
7
Step 8: Save the file in a folder and then open it in excel
  • Place the cell in the first column
  • Click on the menu – Data
  • Then click on Text to columns
  • Click on Next
  • Select “Comma” in the delimiters and click on Finish button
8
Step 9: Enter the data in respective columns.
  • You can enter multiple records and make sure customer groups are already created in AX in advance and use the same values in this sheet.
  • Once after completion of the data
  • Save the file as “CSV (Comma delimited)” in a folder
9
Step 10: Upload the excel file in the Processing group
Navigation: Data import export framework > Common > Processing group – Entities button
  • Browse the file which is created in the above Step 9
  • Click on Generate source mapping (an info log will be shown as “Customer’ entity mapping done successfully”)
  • The validate the file (an info log will be shown as “Customer’ entity is validated for data import/export”)
10
Step 11: Preview of the data
  • You can get a preview of the data which is to be uploaded
11
Step 12: Get staging data
Navigation: Data import export framework > Common > Processing group
  • Select the Processing group – Customer
  • Then click on “Get staging data”
12
Step 13: Staging job
  • A Staging job form will be opened
  • Job ID
  • Enter the description
  • Then click on OK
13
Step 14: Run the staging data
  • You can even get the preview of the data at the lower pane of the form
  • Click on Run button to execute the staging
14
  • We can even setup Batch processing by selecting the Batch check box and setup Recurrence
  • To execute the job immediately, Click on OK
15
  • An info log is generate for the same showing the number of records inserted
16
Step 15: Copy data to target
Navigation: Data import export framework > Common > Processing group
  • Select the Entity – Customer
  • Click on Copy data to target
17
Step 16: Select a Job Id
  • Select the Job ID which is created in the above Step 13
  • Click on OK
18

Step 17: Run the Job
  • Select the Entity and Run the Job
19

  • We can even setup Batch processing by selecting the Batch check box and setup Recurrence
  • To execute the job immediately, Click on OK
20
  • An info log is generate for the same showing the number of records inserted
21
Step 18: View the records uploaded in AX
Navigation: Accounts Receivable > Common > Customers > All customers
  • Filter with the starting alphabet “C-*” to view the records
  • 3 Customer records are created
  • We can edit and enter additional information if required
22

Note: The same process can be used to upload the Vendor Master, for this you need to create Processing Group as Vendor in Step 4 and select the Entity as Vendor in Step 5 and continue with the rest of the steps.




Monday, 11 January 2016

functions in ax 2012(con,date,str)

static void CON_FunctionsAll(Args _args)
{
    date        d,lastdayofmth;
    int         m,n,o,p;
    str         s;
    real        r,a,q;
    int iAmounts[1];
   // d = mkDate(1,1,2001);
    //m = MonthsOfYear(systemDateGet());
    m = dayOfMth(systemDateGet());
    s= dayName(dayOfMth(today()));
    o = dayOfWk(today());
    p = dayOfYr(systemDateGet());
    r = decRound(1234.56789,-4);
    a = dg(100,20);
    q = frac(1234.456);
     //n = mthOfYr(systemDateGet());
    info(strFmt("%1--%2 --%3--%4",s,m,o,p));
    info(strfmt("%1--%2--%3",r,a,q));
    info("--(Next, normal int array, dimOf() accepts it.)");
    info(int2Str(dimOf(iAmounts)));
    print "Current function context is " + funcName();
    pause;
 
    /*int         i;
    i = enumCnt(NoYes);
    info(strFmt("%1",i));
    info(formStr(CustTable));*/
-------------------------------------------------------------------
    str s,p,q,r,t,u,v,w,x,y,z,b;
    int i,j,a;
    p = strDel("asqwert",2,3);
    i = strFind("asqwert","s",2,3);
    s = strColSeq("ASDFGHasdfgh");
    q = strIns("abcdef","123",4);
    r = strKeep("asdfgsdfasdfgds","sdg");
    j = strLen("lokiju");
    t = "first-line\nsecond-line\nlast-line";
    u = strLTrim("     1234-4321");//strRTrim
    v = strLwr("ASDCasdc");//strUpr
    w = strPoke("asdf","12",2);
    x = strPrompt("ch",6);
    y = strRep("ab",6);
    z = strRem("AbcdfGBa","abg");
    a = strScan("abcdefghij","ab",1,10);
    b = subStr("abcdefghij",5,3);
    info(strFmt("%1--%2--%3--%4--%5--%6--%7--%8--%9--%10--%11--%12",s,p,i,q,r,j,u,v,w,x,y,z));
    info(strFmt("%1--%2",a,b));
    info(strLine(t,2));

//o/p:
info1: asdfghasdfgh--aert--2--abc123def--sdgsdsdgds--6--1234-4321--asdcasdc--a12f--ch..: --abababababab--AcdfGB
info2: 1--efg
info3: last-line
-------------------------------------------------------------------
   /* container c = [1,2,3,4,"chaitu","kumar",3.14];
       int i;
    for(i=1;i <= conLen(c);i++)
        {
            info(strFmt("%1",conPeek(c,i)));
        }*/
-------------------------------------------------------------------
    container c = ["item1", "item2", "item3"];
    int i;
    int j;
    ;
    //c =  connull();
    c = conPoke(c,2,"Reddy");
    c = conIns(c,4,"chaitu");
    info(strFmt("%1 %2",conPeek(c,4),conPeek(c,2)));
 
    //info(strFmt("%1",conPeek(c,1)));
    //info(strFmt("%1",conLen(c)));
    //i = conPoke(c, 1,"12345")
    //i = conFind(c, "item2");
    j = conFind(c, "item1");
    //info(int2str("%1",conLen(c)));
    //(strFmt("%1",));  

    /*container       c = [1234, "chaitu",3.14];
    c = conPeek(c,3);
    //c = conDel(c,1,2);
    info("Deleted items");*/
 -------------------------------------------------------------------
    /*date d,lastdayofmth,prevemth,nextyear,preveqtr;  
    d = mkDate(1,11,2016);
    info(strFmt("%1",d));
    lastdayofmth = endmth(today());
    nextyear     = nextYr(today());
    prevemth     = prevMth(systemDateGet());
    preveqtr     = prevQtr(systemDateGet());//nextQtr(systemDateGet());
    info(strFmt("%1",lastdayofmth));
    info(strFmt("%1",prevemth));
    info(strFmt("%1",nextyear));
    info(strFmt("%1",preveqtr));*/
   /* int d,month,years;
    d = dayOfMth(systemDateGet());
    month = mthOfYr(systemDateGet());
    years = year(systemDateGet());
    info(strFmt("%1",month));
    info(strFmt("%1",years));
    info(strFmt("%1",d));*/
 
    //any2guid
    /*//any2enum
    noyes mynoyes;
    int i;
    str s;
    ;
    i = 0;
    mynoyes = any2enum(i);
    info(strFmt("%1",mynoyes));
    Global::info(strfmt("'%1' - is the output, from input of the %2 as int.", myNoYes, i));*/
    /*
    //any2date
    date    mydate;
    str     s;
    int     i;
    ;
    s = "2010 6 17";
    mydate = any2date(s);
    info(strFmt("%1",mydate));
    i = 40361;
    mydate = any2date(i);