Thursday 3 December 2015

Microsoft Dynamics AX 2012 R3 with cumulative update 10

Microsoft has recently released the latest update cumulative update 10 for AX 2012 R3 which comes with the build number of 6.3.3000.110.

What's new in Microsoft Dynamics AX 2012 R3 - CU10 is found below the link.

MicrosoftDynamicsAX2012R3-CU10

Friday 18 September 2015

AX 2012 components access and its permissions

Component
Additional permissions that are required to install the component
Databases
  • Membership in the dbcreator server role in Microsoft SQL Server
  • Membership in the securityadmin server role in SQL Server
  • Membership in the db_accessadmin database role in SQL Server for the Microsoft Dynamics AX database
If you install the databases remotely from a computer other than the database server, you must log on to the remote computer by using an account that is an administrator on the SQL Server computer. Setup requires access to SQL Server services.
Application Object Server (AOS)
Membership in the sysadmin role on the instance of SQL Server that you want to connect to
Enterprise Portal for Microsoft Dynamics AX
  • Membership in the System administrator role in Microsoft Dynamics AX
  • Membership in the Administrators group in Windows on the Web server
  • Membership in the Farm Administrators group in Microsoft SharePoint 2010 products
  • Membership in the dbcreator role on the instance of SQL Server that is used for SharePoint 2010 products
  • Membership in the WSS_Content_Application_Pools database role in the SharePoint_Config database
Enterprise Search
  • Membership in the System administrator role in Microsoft Dynamics AX
  • Membership in the Administrator group in Microsoft SharePoint Services
  • Membership in the dbcreator role on the instance of SQL Server that is used for Microsoft SharePoint Services
Help server
Membership in the System administrator role in Microsoft Dynamics AX
Management Reporter (server components)
  • Membership in the sysadmin role on the instance of SQL Server that you want to connect to.
  • To finish the initial configuration of Management Reporter, membership is required in the Administrator role in Management Reporter.
Microsoft SQL Server Reporting Services extensions
Membership in the System administrator role in Microsoft Dynamics AX
Microsoft SQL Server Analysis Services configuration
  • Membership in the System administrator role in Microsoft Dynamics AX
  • Membership in the SQL Server securityadmin server role
  • Membership in the SQL Server db_owner database role for the Microsoft Dynamics AX database
Client
None
Microsoft Office add-ins
None
Remote Desktop Services integration
None
Report Designer for Management Reporter (client component)
None
Debugger
None
Visual Studio Tools
None
Trace Parser
None
Web services on Internet Information Services (IIS)
Membership in the System administrator role in Microsoft Dynamics AX
.NET Business Connector
None
Synchronization proxy
  • Membership in the dbowner database role in the SQL Server database for Microsoft Project Server
  • Membership in the System administrator role in Microsoft Dynamics AX
Synchronization service
Membership in the System administrator role in Microsoft Dynamics AX
Management utilities
None
Retail Headquarters
None
Retail POS
None
Commerce Data Exchange: Synch Service (Retail Store Connect)
To install Synch Service, no additional permissions are required. To configure Synch Service, membership is required in the sysadmin role on the instance of SQL Server that you want to connect to.
Commerce Data Exchange: Real-time Service (Retail Transaction Service)
None
Commerce Data Exchange: Async Server
To install Async Server, no additional permissions are required. To configure Async Server, membership is required in the sysadmin role on the instance of SQL Server that you want to connect to.
Commerce Data Exchange: Async Client
To install Async Client, no additional permissions are required. To configure Async Client, membership is required in the sysadmin role on the instance of SQL Server that you want to connect to.
Retail Channel Configuration Utility (Retail Store Database Utility)
To install the utility, no additional permissions are required. To configure databases, membership is required in the sysadmin role on the instance of SQL Server that you want to connect to.
Retail SDK (Retail POS Plug-ins)
None
Retail Online Channel
None
Retail Server
None
Retail mass deployment toolkit
None
Modern POS
None
Retail channel database
None
Retail hardware station
None
RapidStart Connector
None
Warehouse Mobile Devices Portal
None
Data Import/Export Framework
  • Membership in the dbdatareader and dbdatawriter roles on the instance of SQL Server that you want to connect to
  • Membership in the System administrator role in Microsoft Dynamics AX
VSS writer
Membership in the Administrators group on the computer where Microsoft System Center 2012 Data Protection Manager (DPM) is installed
Connector for Microsoft Dynamics
  • Permission to query for entries in Active Directory
  • Membership in the SQL Server dbcreator server role
  • Membership in the SQL Server securityadmin server role
  • Membership in the sysadmin database role on the SQL Server instance that hosts the Microsoft Dynamics Integration (MSDI) database

Tuesday 30 June 2015

Copy dimension from one table to another in Ax 2012

Use the below method to copy the dimension from one table another table by passing the default dimension value.

public DimensionDefault copyDimension(
    DimensionDefault _defaultDimension,
    DimensionCopy    _dimensionCopy = DimensionCopy::newFromTable(this, CompanyInfo::findDataArea(this.company()).RecId)
    )
{
    return _dimensionCopy.copy(_defaultDimension);
}


Wednesday 17 June 2015

Specific dimension display in Ax 2012

private Description DimensionbyDept()
{
    DimensionAttributeValueSetStorage dimStorage;
    Counter i;
    str 20 dim;
    int64 n;

    dimStorage = DimensionAttributeValueSetStorage::find("DefaultDimension");

        for (i=1 ; i<= dimStorage.elements() ; i++)
    {
        if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == 'Department')
        {
            n= dimStorage.getValueByIndex(i);
        }
        dim = DimensionFinancialTag::find(n).Description;

    }
    return dim;

Microsoft Dynamics AX 2012 R3 cumulative update 9

Recently Microsoft released cumulative update 9 for AX 2012 R2 and R3.

Please follow the link to get to know the features comes with latest update pack.

AX 2012 R3 cumulative update 9

Tuesday 2 June 2015

The call to clear the report server caches failed in AX 2012





You'll be getting the below error when refreshing the Report server caches in
AX 2012 Development ->Tools->Caches-> Refresh report server.








Even if you try to validate the report server configuration too, will end up in error.
Try running Ax 2012 as Run as Administrator and check the same.

Deleting unused Main Account Values in Ax 2012

A financial dimension value is based on the Main Account  record and has been used on a transaction, You cannot delete the Main Account record. 

In order to get rid off un-used dimension values, delete the related records in the following tables
1.DimensionAttributeValueCombination
By default the ledger dimension values are stored in DimensionAttributeValueCombination.
The DimensionAttributeValueCombination table contains information about accounts and various dimensions combinations that are used. Anything that uses dimensions will hold reference to a record on this table. 
2.DimensionAttributeLevelValue
This table contains the usage of  a dimension attribute value in a given dimension hierarchy.
3.DimensionAttributeValueGroup
This table represents a group of values for the specific dimension set.
4.DimensionAttributeValueGroupCombination
It contains the usage of dimension code groups in a  dimension code combination.
It allows a group to be re-used in multiple combination.
5.DimensionAttributeValue
This table contains the values, such as dimension codes, for a specific dimension.

After removing the reference records in the above tables, you can remove main account from its master itself.


Tuesday 31 March 2015

Mailing PO confirmation report in Ax 2012

PO confirmation report has to be sent mail once gets confirmed.
Default standard Ax will print the report using PurchPurchOrderJournalPrint,
to mail the report, the code has to written in the PurchPurchOrderJournalPrint,doPrint() method
as below
/// <summary>
/// Prints the document.
/// </summary>
protected void doPrint()
{
    this.printConfirmReport();
    this.sendmail(vendPurchOrderJour);

    vendPurchOrderJour.printJournal(this, journalList);
}

private void printConfirmReport()
{
    Args                        parameters = new Args();
    SRSPrintDestinationSettings printSettings;
    SrsReportRunController      controller = new SrsReportRunController();
    PurchPurchaseOrderContract  contract = new PurchPurchaseOrderContract();
    FILENAME                    filename;
    boolean                     newLine;
    Name                        filenamepath;
    ;
    newLine = journalList.first(vendPurchOrderJour);
    parameters.caller(this);
    if (journalList)
    {
        parameters.object(journalList);
    }
    controller.parmReportName(ssrsReportStr(PurchPurchaseOrder, Report));
    contract.parmRecordId(vendPurchOrderJour.RecId);
    contract.parmDocumentTitle("@SYS25545");
    controller.parmReportContract().parmRdpContract(contract);
    controller.parmShowDialog(false);
    printSettings = controller.parmReportContract().parmPrintSettings();
    printSettings.printMediumType(SRSPrintMediumType::File);
    printSettings.fileFormat(SRSReportFileFormat::PDF);
    printSettings.overwriteFile(true); 
    filenamepath = PurchParameters::find().PurchConfirmationFilepath;   
    filename = filenamepath + curext() + '_' +vendPurchOrderJour.PurchOrderDocNum + '.PDF';   
    printSettings.fileName(filename);
    controller.parmArgs(parameters);
    controller.startOperation();
}
private void IMX_sendmail(VendPurchOrderJour _vendPurchOrderJour)
{

SysMailer           mailer = new SysMailer();
SysEmailParameters  parameters = SysEmailParameters::find();
FilePath            filePath;
HcmWorker           hcmWorker;
PurchTable          purchTable;
Name                filename;
;
if (parameters.SMTPRelayServerName)
{
    mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
                        parameters.SMTPPortNumber,
                        parameters.SMTPUserName,
                        SysEmailParameters::password(),
                        parameters.NTLM);
}
else
{
    mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
                            parameters.SMTPPortNumber,
                            parameters.SMTPUserName,
                            SysEmailParameters::password(),
                            parameters.NTLM);
}
filename = PurchParameters::find().PurchConfirmationFilepath;
purchTable  = PurchTable::find(_vendPurchOrderJour.PurchId);
hcmWorker   = HcmWorker::find(purchTable.Requester);
mailer.subject(_vendPurchOrderJour.PurchId);
mailer.fromAddress(DirPartyTable::findByName(UserInfoHelp::userName(curUserId())).primaryEmail());
mailer.htmlBody('Purchase Order confirmation of ' + _vendPurchOrderJour.PurchId +'.' + 'Please Find the Attachment.');
mailer.tos().appendAddress(hcmWorker.email());
mailer.tos().appendAddress(VendTable::find(purchTable.OrderAccount).email());
filePath = filename + curext() + '_' +vendPurchOrderJour.PurchOrderDocNum + '.PDF';
mailer.attachments().add(filePath);
mailer.sendMail();
CodeAccessPermission::revertAssert();
}

Correct me if am wrong....

Wednesday 25 March 2015

Copying Document Handling from one document to another document in Ax 2012

How to replicate the same document handling (File,Notes etc) from one document(Sales) to another document (Purchase).
Ex
If we want to show the Sales Document Handling Notes to Purchase Order, when we are creating direct delivery from Sales order to purchase order
then pass the following get the document handling

FromTable = salesTable;
ToTable     = purchTable;
Docu::copy(FromTable,ToTable);

Tuesday 24 March 2015

Selection Highlighter Extension for Ax 2012

Follow the below link to enhance your Ax client with Editor extension to have the following features in AX client as Visual Studio does.
1.Brace Matching Extension
2.highlight words Extension
3.Outlining Extension
Microsoft Dynamics AX 2012 X++ Editor Extensions 


Friday 20 March 2015

Job for container looping through Legal entity via X++, AX 2012

static void Containerloop(Args _args)
{
    int i;
    container   allLegalentity;
    str         con;

    allLegalentity = conNull();
    allLegalentity = ['USMF','JPMF','INMF'];

    while (conLen(allLegalentity) > 0)

    {
        i++;
        con = conPeek(allLegalentity,i);

        changeCompany(con)
        {
            // code statement
            info(strFmt("%1)  %2",i,con));

        }

        if (i >= conLen(allLegalentity))
        break;
    }

}

Wednesday 4 March 2015

Getting exchange rate value in ax 2012

public static CurrencyExchangeRate currencyConversion(CurrencyCode fromCurrencyCode, CurrencyCode toCurrencyCode)
{
    ExchangeRateCurrencyPair exchangeRateCurrencyPair,exchangeRateCurrencyPair2;
    ExchangeRateDisplayFactor exchangeRateDisplayFactor;
    ExchangeRate exchangeRate;
    date validFromDate = dateNull();
    date validToDate = dateMax();


    CurrencyCode _fromCurrencyCode =  fromCurrencyCode;
    CurrencyCode _toCurrencyCode = toCurrencyCode;
    ExchangeRateTypeRecId _exchangeRateType2;
    boolean _getReciprocalIfPrimaryNotFound = true;

    CurrencyExchangeRate exchRateValue;

    _exchangeRateType2 = ExchangeRateType::findByName(Exchange Rate Type).RecId;


    select firstonly ExchangeRateDisplayFactor
        from exchangeRateCurrencyPair
        where exchangeRateCurrencyPair.FromCurrencyCode == _fromCurrencyCode
            && exchangeRateCurrencyPair.ToCurrencyCode == _toCurrencyCode
            && exchangeRateCurrencyPair.ExchangeRateType == _exchangeRateType2;
    if(exchangeRateCurrencyPair.ExchangeRateDisplayFactor)
    {

        select firstonly validtimestate(validFromDate, validToDate) exchangeRate
        where
        exchangeRate.ExchangeRateCurrencyPair == exchangeRateCurrencyPair.RecId;
        exchRateValue = ExchangeRateHelper::displayStoredExchangeRate_Static(
                exchangeRate.ExchangeRate,
                exchangeRateCurrencyPair.ExchangeRateDisplayFactor);
    }
    else
    {
       select firstonly ExchangeRateDisplayFactor
        from exchangeRateCurrencyPair2
        where exchangeRateCurrencyPair2.FromCurrencyCode == _toCurrencyCode
            && exchangeRateCurrencyPair2.ToCurrencyCode == _fromCurrencyCode
            && exchangeRateCurrencyPair2.ExchangeRateType == _exchangeRateType2;

        if(exchangeRateCurrencyPair2.exchangeRateDisplayFactor)
        {
            select firstonly validtimestate(validFromDate, validToDate) exchangeRate
            where exchangeRate.ExchangeRateCurrencyPair == exchangeRateCurrencyPair2.RecId;

            exchRateValue = exchangeRateCurrencyPair2.ExchangeRateDisplayFactor / ExchangeRateHelper::displayStoredExchangeRate_Static(
                exchangeRate.ExchangeRate,
                exchangeRateCurrencyPair2.ExchangeRateDisplayFactor);
        }
    }
    return exchRateValue;
}

Getting Availablephysical for item based on financial Dimension site in Ax 2012

public InventQty getavailablephysicalqty(ItemId _itemId, DimensionDefault _defualtDimension)
{
    InventSum                       inventSum;
    DefaultDimensionView            defaultDimensionView;
    DimensionAttributeValueSetItem  dimensionAttributeValueSetItem;
    DimensionAttributeValueSet      dimensionAttributeValueSet;
    InventSite                      inventSite;
    InventDim                       inventDimtemp,inventDimdummy;

    select firstonly DisplayValue from defaultDimensionView
        where defaultDimensionView.DefaultDimension == _defualtDimension
        && defaultDimensionView.Name == 'CostCenterSYS';

    select DimensionAttributeValueSet from dimensionAttributeValueSetItem
        where dimensionAttributeValueSetItem.DisplayValue == defaultDimensionView.DisplayValue
    join dimensionAttributeValueSet
        where dimensionAttributeValueSet.RecId  == dimensionAttributeValueSetItem.DimensionAttributeValueSet
    join SiteId from inventSite
        where inventSite.DefaultDimension == dimensionAttributeValueSet.RecId;

    inventDimtemp.InventLocationId  = "";
    inventDimtemp.InventColorId     = "";
    inventDimtemp.InventSizeId      = "";
    inventDimtemp.inventBatchId     = "";
    inventDimtemp.InventStyleId     = "";
    inventDimtemp.inventSerialId    = "";
    inventDimtemp.InventSiteId      = inventSite.SiteId;

    inventDimdummy = InventDim::findOrCreate(inventDimtemp);
    inventDimdummy = null;
   
     select PhysicalInvent from inventSum
         exists join inventDimdummy
            where inventSum.ItemId == _itemId
               && inventSum.Closed == NoYes::No     
               && inventSum.InventDimId == inventDimdummy.inventDimId
               && inventDimdummy.InventSiteId == inventSite.SiteId;

    return inventSum.PhysicalInvent;
}

Wednesday 4 February 2015

Getting Dimension value and description from default dimension in ax 2012

private Description getdimension(DimensionDefault _defualtDimension)
{
    DefaultDimensionView    defaultDimensionView;    
    
    select defaultDimensionView
        where defaultDimensionView.DefaultDimension == _defualtDimension
        && defaultDimensionView.Name == 'CostCenter';    
    
    return defaultDimensionView.dimensionDiscription();   
}

Calculate ledger balance by dimension set in X++ in AX2012/Dynamics 365 FO

There are a variety of ways users can view balances in the general ledger. Some of the most common options are: 1. Trial balance 2. Financia...