Sunday, 31 January 2016

How to change client Language in ax 2012

Hello, 

As you know that Dynmics Ax run on different languages. So I gonna tell you how to change client language country/region specific.

this is nothing but a very simple step to do.

Go To > File > Tools > Options >


After that go to General tab and select the language which you want to use in your client. then apply and exit.

In my case I was using Arabic language. Now restart your client and see the difference.


You can do it from your database also .

Go to Database server . In my case it is sql server 2014.

Select your database > tables > UserInfo > select the user > change the language code.

Done Thanks.

Saturday, 30 January 2016

Report server error rsServerConfigurationError ax 2012 ssrs report / SQL server 2014

Hello ,

Today I ran a ssrs report and got the below error.

Error while setting server report parameters. Error message: The report server has encountered a configuration error. Logon failed for the unattended execution account. (rsServerConfigurationError)

Reason could be that the execution account doesn't have proper access to DB server. In case if you want this to be the desired setting, then In Report Manager Site, select the Credentials are not required option.
Otherwise you can provide proper access to execution account on your db server.

Solution:
Go To > Report Services Configuration Manager > Connect to report services
Now select Service Acount tab and check the Credentials. And Set the right username and password.

Do the same thing with Execution Account then click on apply and Exit.


Now run the same report I will work. 
Thanks.

Wednesday, 27 January 2016

Create record in inventdim table through code X++ in ax 2012

Hi ,

Today I am going to tell you how to create record in inventdim table through code.

In InventDim Table we cant use .insert() method for creating record.

As it is very important table and hit many transaction so it is recommended not to play with this table unless it is not necessary. may be it cause data in consistancy.

But as like me if you have to do with this table you can use below code at your own risk.

Its is working code for sure.

 ttsBegin;
        item = InventTable::find(ItemId);                  // Item id = "Item-0001"
        inventdim.InventSiteId          = Site;              // Site = "Site1"
        inventdim.InventLocationId      = Location;  // Location = "Location1"
        if(item.colorActive())
        {
            inventdim.InventColorId         = color;       // color = "Blue"
        }
        if(item.sizeActive())
        {
            inventdim.InventSizeId          = Size;           // Size = "Small"
        }
        if(item.configActive())
        {
            inventdim.configId              = config;
        }
        if(item.styleActive())
        {
            inventdim.InventStyleId         = style;          // Style = "Round" 
        }
        
        inventDim = InventDim::findOrCreate(inventDim);

ttsCommit;

------------------------------------------------------
hope it will help to resolve your issue

Thursday, 21 January 2016

Number Sequence for existing module in ax 2012

Number sequences are unique identifiers that can be associated with a master record so that they can be individually distinguished. They can be either formatted as alpha-numeric strings or simply as numbers.


Microsoft Dynamics AX 2012 provides an easy to implement framework to generate custom number 
sequences.

Scenario

As part of this tutorial, a custom number sequence will be generated for the Customer Groups setup form (Accounts receivable à Setup à Customers à Customer groups)

Steps

  1. First create a new Extended Data Type (EDT). Open AOT àData Dictionary à Extended Data Types
  2. Right Click on Extended Data Types and create a new EDT NumSeqDemoCustGroupNum of type String
  3. Set the properties as shown below

  4. Now go to AOT à Classes and open the NumberSeqModuleCustomer class by right clicking it and selecting View Code

  5. In the loadModule method, add the following code after the last line of code
  6. //customer group number
    //define the EDT
    datatype.parmDatatypeId(extendedTypeNum(NumSeqDemoCustGroupNum));
    //define its default propertiesdatatype.parmReferenceHelp(literalStr(“Unique number for customer group”));datatype.parmWizardIsContinuous(true);datatype.parmWizardIsManual(NoYes::No);datatype.parmWizardIsChangeDownAllowed(NoYes::No);datatype.parmWizardIsChangeUpAllowed(NoYes::No);datatype.parmWizardHighest(999999);datatype.parmSortField(27);
    //define its scope
    datatype.addParameterType(NumberSeqParameterType::DataArea, truefalse);this.create(datatype);

  7. Now, go to AOT à Jobs and create a new job loadNumSeqCustDemo
  8. Write the following code in the job and then run it
    static void loadNumSeqCustDemo(Args _args){
    //define the class variableNumberSeqModuleCustomer seqMod = new NumberSeqModuleCustomer();
    //load the number sequences that were not generatedseqMod.load();}

  9. Now, go to Organization administration à Common à Number sequences à Number sequences
  10. Click on Generate button in the New button group
  11. In the Setup number sequences wizard, Press Next
  12. In the Setup set different values for the number sequence like the format, highest value and lowest value
  13. Click Next
  14. In the last step, Click Finish to generate the number sequences
  15. The number sequence is generated and can be used on the Customer Groups form
  16. Open AOT à Data Dictionary à Tables à CustGroup
  17. Add a new String field and set the properties as follows
  18. Add the newly added field in the Overview field group
  19. Now go to Forms àCustGroup and restore the form. It will add the newly added field in the grid
  20. Write the following code on the Class declaration node
     NumberSeqFormHandler numberSeqFormHandler;

  21. Create a new method on the form and write the following code
    NumberSeqFormHandler numberSeqFormHandler(){
    if (!numberSeqFormHandler){
    //create a reference of number sequence form handler class specifying the         EDT, Data source name and the field of the table
    numberSeqFormHandler =NumberSeqFormHandler::newForm(NumberSeqReference::findReference(extendedtypenum(NumSeqDemoCustGroupNum)).NumberSequenceId, element,CustGroup_DS,fieldnum(CustGroup,CustGroupNumber));}return numberSeqFormHandler;
    }

  22. Override the close method of the form and write the following code
    public void close(){
    if (numberSeqFormHandler)
    {numberSeqFormHandler.formMethodClose();}
    super();}

  23. Override the create method on the CustGroup data source and add the following code
    public void create(boolean _append = false){
    element.numberSeqFormHandler().formMethodDataSourceCreatePre();
    super(_append);
    element.numberSeqFormHandler().formMethodDataSourceCreate(true);}

  24. Override the write method on the CustGroup data source and add the following code
    public void write(){
    super();
    element.numberSeqFormHandler().formMethodDataSourceWrite();}

  25. Override the validateWrite method on the CustGroup data source and add the following code
    public boolean validateWrite(){
    boolean ret;
    ret = super();
    ret = element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret) && ret;
    return ret;}

  26. Override the delete method on the CustGroup data source and add the following code
    public
    void delete()
    {
    element.numberSeqFormHandler().formMethodDataSourceDelete();
    super();}

  27. Override the linkActive method on the CustGroup data source and add the following code
    public
    void linkActive()
    {
    element.numberSeqFormHandler().formMethodDataSourceLinkActive();
    super();}

  28. Now go to Accounts receivable à Setup à Customers à Customer groups
  29. Create a new record. The number sequence is generated according to the format defined as shown below

Reports showing username and password when opening SSRS report

Reports showing username and password when opening SSRS report

When opening a report you see the username and password dialog















Now what is the possible reason for this issue. You might have changed your AX reporting service account to any other account in the reporting service extension recently, as shown below.

Note : In my case I did the same. 



Solution : To resolve this issue I just redeployed all my reports from AOT and issue gone.  

Please check with any one report. If u get your issue resolved then redeploy all your report.

Thanks. 



Wednesday, 13 January 2016

You are not authorized to access table "abcTableName" (Table Name). Contact your system administrator

You may experience the subject mentioned error while opening a table / view


 


Solution : There are two solution for this error and  its depend on error you are facing

1. If it is because of view then check the view. is there any field available or not. Just add a field in ur view and problem will be solve.



2. If it is because of Table then check configuration key for that table is enable or not

go to > system administration > Setup > License > License Configuration > now check your configuration key and enable the same and sync the table.



Tuesday, 12 January 2016

Product / Product Master Import through DIXF 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
Figure 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
Figure 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 (,)”
Figure 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 Product
  • Enter a suitable description
  • Then click on Entities to get the required fields and move on to next step
Figure 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 “Product Master” 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
  • With this entity we can upload Product as well as Product Master.
Figure 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
Figure 6
Step 7: Select the required fields to upload the Product and Product master
  • Select the Field name which are required to upload
  • By default some of the mandatory fields are selected
  • Apart from them you can select some other fields as shown in the below image.
  • Then click on Generate Sample File to generate a notepad for the selected fields with comma delimited
  • Click on Finish button
Figure 7
Step 8: Copy the data from notepad and paste 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
Figure 8
Step 9: Enter the data in respective columns.
  • You can enter multiple records and make sure Product dimension 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
  • For Product select the product sub type as “Product” and product type as “Service” for service items.
Figure 9
  • For Product master select the product sub type as “Product master” and product type as “Item” for item master.
Figure 10
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 “Product entity mapping done successfully”)
  • The validate the file (an info log will be shown as “Product” entity is validated for data import/export”)
  • You can get a preview of the data which is to be uploaded
Figure 11
Step 12: Get staging data
Navigation: Data import export framework > Common > Processing group
  • Select the Processing group – Product
  • Then click on “Get staging data”
Figure 12
Step 13: Staging job
  • A Staging job form will be opened
  • Job ID
  • Enter the description
  • Then click on OK
Figure 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
Figure 14
  • We can even setup Batch processing by selecting the Batch check box and setup Recurrence
  • To execute the job immediately, Click on OK
Figure 15
  • An info log is generate for the same showing the number of records inserted
Figure 16
Step 15: Copy data to target
Navigation: Data import export framework > Common > Processing group
  • Select the Entity – Product
  • Click on Copy data to target
Figure 17
Step 16: Select a Job Id
  • Select the Job ID which is created in the above Step 13
  • Click on OK
Figure 18
Step 17: Run the Job
  • Select the Entity and Run the Job
Figure 19
  • We can even setup Batch processing by selecting the Batch check box and setup Recurrence
  • To execute the job immediately, Click on OK
Figure 20
  • An info log is generate for the same showing the number of records inserted
Step 18: View the records uploaded in AX
Navigation: Product information management > Common > Products > Products
  • 4 records are created
  • We can edit and enter additional information if required
Figure 21
Note: The same process can be used to upload the Product Master by creating the data in the same file or in a different file and repeat from step 10.