Wednesday, 9 December 2015

To Export a model using command prompt:

1. Open command prompt as run as administrator
2. change the directory to management utilities 
for ex: if the managementUtilities are present in E:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities
3. change directory to E drive using cd E:
4. once the directory is changed enter the command E:> E:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities
5. E:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities> axutil export /model:DES /file:BPCheck (where DES is the existing model and BPCheck is the filename we need to export) 
Finally the model will be exported to E:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities.

Friday, 4 December 2015

To Find the phone number of the customer:


    LogisticsElectronicAddress LogisticsElectronicAddress;
    DirPartyLocation DirPartyLocation;
    int contactPhoneCounter = 0;

    while select Locator from LogisticsElectronicAddress exists join DirPartyLocation
    where
    DirPartyLocation.Party == _custInvoiceJour.custTable_InvoiceAccount().Party
    &&
    DirPartyLocation.location == LogisticsElectronicAddress.location
    && LogisticsElectronicAddress.type == LogisticsElectronicAddressMethodType::Phone
    {
        contactPhoneCounter++;
        if (contactPhoneCounter==1)
        {
                cachedCompanyContactPhone1 = LogisticsElectronicAddress.Locator;
        }
        else if (contactPhoneCounter==2)
        {
            cachedCompanyContactPhone2 = LogisticsElectronicAddress.Locator;
        }
        else
        {
            break;
        }
    }