Monday, 1 December 2014

The formatter threw an exception while trying to deserialize the message



Steps to resolve the error
1. User session Kill
2. sysclientsessions - Delete table records
3.Stop the AOS
3. C:\Users\aosservice\AppData\Local -  AUC and KTI file format deletion
4. C:\Users\aosservice\AppData\Local\Microsoft\Dynamics Ax\VSAssemblies - AUC file format deletion
5.Start the AOS.


AX 2012 Job to kill users/sessions

Static Killusers(Args _args)
{
      SysUsersTerminate usersTerminate;
      SysClientSessions sysUserSession;
      UserInfo userInfoTable;
      container usersList;
      ;   

         while select sysUserSession
         where sysUserSession.userId != curUserId()
          { 
           usersList +=   [[sysUserSession.userId,sysUserSession.SessionId,sysUserSession.LoginDateTime]];
          }
        usersTerminate = SysUsersTerminate::newUsersList(usersList);
        if (usersTerminate.prompt())
         usersTerminate.run();

      pause;
}

Wednesday, 26 November 2014

Table Groups and Uses in Ax 2012



Table Groups

AX 2012 R3 CU8 is released

Microsoft Dynamics AX2012 R3 CU 8 (KB2998197) is released

The version number of this release is 6.3.1000.309.

Please follow the link to find the Functional and Developer features comes with the update

release features

you can download the update from the below location
AX 2012 R3 CU8

Friday, 21 November 2014

Reading Customer from C# AIF Service Ax 2012

static void Main(string[] args)
{
    string customer = "US-004";

    AxdCustomer foundCustomer = null;

    CallContext context = new CallContext();

    context.Company = "USMF";
    // CON_ReadCustomer.Con_ReadCustomerServiceReference.CustomerService proxy = new CON_ReadCustomer.Con_ReadCustomerServiceReference.CustomerService();

    CustomerServiceClient proxy = new CustomerServiceClient();

    try
    {

        foundCustomer = proxy.read(context, Program.readCritera(customer));
        Console.WriteLine("AccountNum : " + foundCustomer.CustTable[0].AccountNum);
        Console.WriteLine("CustGroup : " + foundCustomer.CustTable[0].CustGroup);
        Console.WriteLine("Name : " + foundCustomer.CustTable[0].Name);
        //Console.WriteLine("Name : " + foundCustomer.CustTable[0].Name);
        Console.ReadLine();

    }

    catch (Exception e)
    {
            Console.WriteLine(e.Message);         
    }


    public static EntityKey[] readCritera(string customerAccount)
    {

        AxdEntity_CustTable custTable = new AxdEntity_CustTable();

        EntityKey[] entityKeyList = new EntityKey[1];

        EntityKey key = new EntityKey();

        KeyField[] keyFields = new KeyField[1];

        KeyField keyField = new KeyField();

        keyField.Field = "AccountNum";

        keyField.Value = customerAccount;

        keyFields[0] = keyField;

        key.KeyData = keyFields;

        entityKeyList[0] = key;

        return entityKeyList;
    }

}

Getting Table Fields in AX 2012

Ax 2012 Job to get Table fields

static void TableObjects(Args _args)
{
    DictTable   d = new DictTable(tableNum(AccountantLogisticsLocation_BR));
    int         i;
    int         cnt = d.fieldCnt();
    str         nameForLookup;
    FieldId     fieldid = d.fieldNext(0);;


    for (i = 1; i <= cnt; i++)
    {
        if (!d.isDefaultData())
        {
            nameForLookup = d.fieldName(fieldid);
            if (d.fieldSqlDefault(fieldid))//skip default table fields
            {
                info(nameForLookup);
            }
            else
            {
                continue;
            }
            fieldId = d.fieldNext(fieldId);

        }

    }
   
}

Best Practices for Troubleshooting Application Issues in D365 and Power Platform

When facing application issues, it’s important to systematically troubleshoot before reaching out for support.  Follow these steps to ensure...