Tuesday, September 23, 2014

DB Restore Error: Restore failed for server 'ServerName'. (Microsoft.SqlServer.SmoExtended):

I created a testing environment(test1_MSAX) for one of my Live-Organisation through Import Organization in the deployment Manager. For some further RnD purpose, I wanted to create yet another test organization (test2_MSAX) for the same Live-Organization on the Same server where I already had previous test1_MSAX.
Error:
 
Solution:
  • Click on Options.
  • At right side, Under ‘Restore the database file as:‘ section. The first column represent the original file names of file type .mdf and .ldf and right most column represents the file name which you want to provide and restore the DB file as.


  • Click on the browse button and scroll all the way to see the file name and change it to your preferred name(test2_MSAX.mdf and test2_MSAX.ldf).
     
    After changing the restore database file name as, my DB restore succeeded.

     

    Friday, September 19, 2014

    Downgrading a SQL Server 2012 database to SQL Server 2008 R2

    Different Databases for Ax 2012 in Sql Server


    Databases include the Microsoft Dynamics AX DataBaseModel, and the Baseline database.

    1. The AOS connects to the Microsoft Dynamics AX database to process transactions.
    2. The AOS connects to the model store to display application elements such as forms and reports.
    3. The baseline database contains a model store that is used to upgrade X++ code to Microsoft Dynamics AX 2012. The baseline database is used to analyze application updates before they are applied.
    Other Microsoft Dynamics AX components, such as Enterprise Portal and Reporting Services extensions, also include databases. The additional databases are created when you install those components and their prerequisites.

    SalesOrder and PurchaseOrder classes and Tables

    SalesOrder Classes and Tables:
    SalesTableType and SaleslineType classes will get called while creating the SalesOrders.
    SalesFormLetter_Confirm
    SalesFormLetter_Invoice
    SalesFormLetter_PackingSlip
    SalesFormLetter_PickingLlst
    classes will be used to post the sales order at various document status (packing, invoice etc).
    Tables:
    SalesTable contains all SalesOrder headers regardless whether they have been posted or not.
    The SalesParmTable and SalesParmLine contains detailed information regarding posting sales headers and Lines.
    CustConfirmJour and CustConfirmTrans tables contains all Sales Confirmation headers and Lines posted in Dynamic Ax originating from Sales Orders and Lines.
    CustPackingSlipJour and CustPackingSlipTrans tables contains all sales PackingSlip headers and Lines posted in Dynamic Ax originating from Sales Orders and Lines.
    CustInvoiceJour and CustInvoiceTrans tables contains all sales all Sales Invoice headers and Lines posted in Dynamic Ax originating from Sales Orders and Lines.

    PurchaseOrder classes and Tables:
    PurchTableType and PurchTableLine classes will get called while creating the PurchaseOrders.
    PurchFormLetter_PurchOrder
    PurchFormLetter_ApproveJournal
    PurchFormLetter_Invoice
    PurchFormLetter_PackingSlip
    PurchFormLetter_ReceiptsList
    classes will be used to post the PurchaseOrder at various document status (packing, invoice etc).
    Tables:
    PurchTable contains all purchase order headers regardless whether they have been posted or not.
    PurchParmTable and PurchParmLine contains detailed information regarding posting Purchase headers and Lines.
    VendPackingSlipJour and VendPackingSlipTrans tables contains posted packingslip headers and lines.
    VendInvoiceJour and VendInvoiceTrans tables contains all invoiced purchase order headers and Lines.
    VendReceiptsJour and VendReceiptsTrans tables contains posted receipt header and lines.
    VendPurchOrderJour and VendPurchOrderTrans tables contains Purchase requisition headers and lines.

    How to create SalesOrder :
    http://www.dynamicsaxtraining.com/dynamics-ax-trade-and-logistics-training/create-sales-order
     

    Wednesday, September 10, 2014

    Table Level Best Practices

    When you create a new table, set the relevant table properties in the property sheet.
    Incorrect table property settings can negatively affect performance and manageability.

     

    Monday, September 8, 2014

    How to check sql server is running which bit (32 or 64 bit) version

    by using @@version :

    Open SQL Server Management Studio>right click on the DB Server> select New Query

    select @@version

    Result:

    Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (Intel X86)   Apr 22 2011 11:57:00   Copyright (c) Microsoft Corporation  Developer Edition on Windows NT 6.1 <X64> (Build 7600: ) (WOW64)

     Server Name:

    select @@servername

    Service Name:

    select @@servicename
     

    Thursday, September 4, 2014

    Collection Classes

    In AX collection classes have been designed for storing objects.
    The classes are implemented in C++ to achieve the maximum performance (they are system classes).
    collection classes are extended with Object class.

    Array: Similar to the X++ language array type except that it can hold values of any single type, including objects and records. Objects are accessed in a specific order.

    http://msdn.microsoft.com/EN-US/library/array.aspx

    List: Contains any number of elements that are accessed sequentially.
    Lists are structures that can contain values of any X++ type.
    All the values in the list must be of the same type.

    http://msdn.microsoft.com/EN-US/library/list.aspx

    Map: The Map class allows you to associate one value (the key) with another value.
    Both the key and value can be any valid X++ type, including objects.
    The types of the key and the value are specified in the declaration of the map.
    The way in which maps are implemented means that access to the values is very fast.

    http://msdn.microsoft.com/EN-US/library/map.aspx

    Struct:  A struct holds several values of any X++ type, to group the information about a specific entity.

    http://msdn.microsoft.com/EN-US/library/struct.aspx

    Set:The Set class is used for the storage and retrieval of data from a collection in which the values of the elements contained are unique and serve as the key values according to which the data is automatically ordered.

    http://msdn.microsoft.com/EN-US/library/set.aspx

    Changes to the Collection Classes in Dynamics AX 2012

    http://blogs.msdn.com/b/x/archive/2011/09/07/changes-to-the-collection-classes-in-dynamics-ax-2012.aspx



     

    Tuesday, September 2, 2014

    AOSAuthorzation property on Tables

    The AOSAuthorization table property enables you to specify which data access operations must undergo user permission checking.

    The four fundamental data access operations are create, read, update, and delete.

    1. None (Default)
    2. CreateDelete
    3. UpdateDelete
    4. CreateUpdateDelete
    5. CreateReadUpdateDelete
    the above operations  are represented the combination of AOSAuthorization enumaration values.

    No permission checking is done when the AOSAuthorization property is set to None.

    Ex: Suppose AOSAuthorization is set to CreateDelete on a given table.
    In this case, create and delete operations would be allowed to execute only if the Application Object Server (AOS) can confirm that the user has the appropriate permissions.
    Update and read operations would execute without checking user permissions, because they are not mentioned in the chosen AOSAuthorization value.

    The AOSAuthorization property also applies to views.

    Ex: For example, suppose view Vew2 reads data from table Tab3. You have no read permission to either Vew2 or Tab3. The AOSAuthorization value on Vew2 is None, but on Tab3 it is CreateReadUpdateDelete. When you try to read from Vew2 the outcome will be a successful retrieval of data.

     

    Monday, September 1, 2014

    TableGroup

    Table groups provide a method for categorizing tables according to the type of data they contain.

    Use:When exporting data, you can use table groups to filter records.
    For example, if you wanted to specify that customers should be exported but customer transactions should not. The table group that a table belongs to is defined by the TableGroup property of the table.
    The groups available are defined by the system Enum TableGroup.

    Parameter:
    The table contains data primarily used as parameters or setup information for one of the main tables (a table that has a TableGroup property of Main).
    The table typically contains only one record per company.
    Ex: CustParameter, VendParameter

    Group:
    The table contains data primarily used to categorize one of the main tables (a table that has a TableGroup property of Main).
    There is a one-to-many relationship between a Group table and a Main table.
    Ex: CustGroup, VendGroup

    Main:
    The table is one of the principal tables in the application and contains data for a central business object. The table typically holds static, base information.
    There is a one-to-many relationship between a Main table and a Transaction table.
    Ex: CustTable VendTable

    Transaction, Transaction header, and Transaction line
    The table contains transaction data. The table is typically not used for data entry directly.
    The tables in the Transaction header table group categorize the tables in the Transaction line table group.
    There is a one-to-many relationship between a Transaction header table and Transaction line tables.
    Ex: CustTrans, VendTrans

    Worksheet, Worksheet header, and Worksheet line
    Tables that contain information that is validated and made into transactions.
    Unlike the data that is contained in the tables in the Transaction table groups, data in the Worksheet table groups is temporary.
    There is a one-to-many relationship between a Transaction header table and Transaction line tables.

    Miscellaneous:
    The table does not fit in any of the other categories. This is the default value for a new table.
    Ex: TableExpImpDef

    Framework :
    Tables that are used by the underlying Microsoft Dynamics AX frameworks, such as Application Integration Framework (AIF). These tables are created during installation and are not associated with configuration keys.

    Reference : Tables that contain reference data.



    Enable/Disable form control based on multiple rows select

     class PurchTableFormEventHandler {      [FormDataSourceEventHandler(formDataSourceStr(PurchTable, PurchTable), FormDataSourceEventType::Act...