Thursday, March 23, 2017

The Accounts Payable cube cube either does not exist or has not been processed.

After deployed the Cubes showing error message :
The Accounts Payable cube cube either does not exist or has not been processed. 

Solution:
System Administrator > Setup > Business Intelligence > Analysis Services > Analysis Servers
 Configure the Default Database "Dynamics initial" in OLAP database TabPage





Sunday, March 5, 2017

How to update Label Id to String through X++ code

static void Lableid2str(Args _args)
{
RetailChannelReport     retailChannelReport;
;
ttsBegin;
while select forUpdate retailChannelReport
{
retailChannelReport.ReportName = SysLabel::labelId2String2(retailChannelReport.ReportName, 'en-us');
print retailChannelReport.ReportName;
retailChannelReport.doupdate();
 }
ttscommit;
pause;
}

Monday, November 7, 2016

How to change colour based on condition in form grid

Form > Datasource>Methods>displayOption

public void displayOption(Common _record, FormRowDisplayOption _options)
{
    Tablename    table;

    if(_record.RecId)
    {
        select  table where table.recid == _record.RecId;
        if(table.Status  == Status::Posted)
        {
            _options.textColor(WinAPI::RGB2int(250,1,1));
        }
    }
    super(_record, _options);
}

Saturday, August 20, 2016

Report Issues in Ax 2012

1 . Problem :
Error while setting server report parameters. Error message: The DefaultValue expression for the report parameter ‘AX_CompanyName’ contains an error: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (rsRuntimeErrorInExpression) in ax 2012

Solution:

http://rahulmsdax.blogspot.in/2015/02/error-while-setting-server-report.html

2 . Problem: 

Publish-AXReport -ReportName *
i got an error:
...
Publish-AXReport : A call to the Microsoft Dynamics AX SRSFrameworkService
service failed. An existing connection was forcibly closed by the remote host.
At line:1 char:1
+ Publish-AXReport -ReportName *
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (Microsoft.Dynam...shReportCommand:Pu
blishReportCommand) [Publish-AXReport], ReportException
+ FullyQualifiedErrorId : A call to the Microsoft Dynamics AX SRSFramework
Service service failed. An existing connection was forcibly closed by the
remote host.,Microsoft.Dynamics.AX.Framework.Management.Reports.PublishRep
ortCommand
....
but i can deploy a single report by its name only, not all at the same command!!

Solution:

Start > Administrative Tools > Microsoft Dynamics AX 2012 Management Shell

run the below script:

foreach ($letter in 97..122) 
{
Publish-AXReport -ReportName "$([char]$letter)*"
}


3.Problem:

Publish-AXReport : Client found response content type of '', but expected
'text/xml'.The request failed with an empty response.
At line:1 char:1
+ Publish-AXReport -ReportName *
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (Microsoft.Dynam...shReportCommand:Pu
   blishReportCommand) [Publish-AXReport], InvalidOperationException
    + FullyQualifiedErrorId : Client found response content type of '', but ex
   pected 'text/xml'.
    The request failed with an empty response.,Microsoft.Dynamics.AX.Framework

   .Management.Reports.PublishReportCommand

Solution: Restart the Sql Server Reporting Service and try to deploy

Thursday, June 23, 2016

How to Get HcmWorker Financial dimensions in ax 2012

add the below code in HcmWorker Table method.

public static str getDimensionValue(HcmWorkerRecId _workerRecId,Name _DimensionName,
                                            utcdatetime _asOfDate = DateTimeUtil::utcNow())
{
    DimensionAttributeValueSetStorage             dimStorage;
    str                                                                dimValue;
    Counter                                                     counter;
    HcmEmployment                                 hcmEmployment;
    RecId                                                 _DefaultDimension;
    ;
    select hcmEmployment where
              hcmEmployment.Worker == HcmWorker::find(_workerRecId).RecId;

    dimStorage = DimensionAttributeValueSetStorage::find(hcmEmployment.DefaultDimension);

    for (counter=1 ; counter<= dimStorage.elements(); counter++)
    {
         if(DimensionAttribute::find(dimStorage.getAttributeByIndex(counter)).Name == _DimensionName)
         {
               dimValue = dimStorage.getDisplayValueByIndex(counter);
              // info(strfmt('%1',dimValue));
         }
    }
    return dimValue;
}

after show make a display method to financial methods.

Idisplay HcmPersonnelNumberId branch( )
{
return HcmWorker::getDimensionValue(HcmWorker::findByPersonnelNumber(this.PersonnelNumber).RecId, 'BRANCH');

}


Thursday, February 4, 2016

How to generate serial number only visible records in SSRS Report

S.NO> function

=RunningValue( IIf(Fields!Payable.Value <= 0, Nothing, Fields!Payable.Value)
    , CountDistinct
    , "Tablix1")

Monday, December 28, 2015

Comparing insert and insert_recordset

Comparing insert and  insert_recordset 

insert()


static void prodinsert(Args _args)
{
 EcoResProduct                           ecoResProduct;
 EcoResProductIdentifier                 ecoResProductIdentifier;
 
 ttsBegin;
 while select ecoResProduct
      
  {
   ecoResProductIdentifier.Product = ecoResProduct.RecId;
   ecoResProductIdentifier.ProductNumber = ecoResProduct.DisplayProductNumber;
   ecoResProductIdentifier.insert();
    }
     ttsCommit;
    

}
insert_recordset()
static void Ecoresprodinsert(Args _args)
{ 
EcoResProduct ecoResProduct; 
EcoResProductIdentifier ecoResProductIdentifier; ;  
insert_recordset ecoResProductIdentifier(Product,ProductNumber)
select RecId,DisplayProductNumber from ecoResProduct;  
{  
info(strFmt("%1",ecoResProductIdentifier.ProductNumber)); }
}

by using joins
https://msdn.microsoft.com/en-us/library/aa635694.aspx

update_recordset with joins

 update_recordset with joins update_recordSet storeTransfer         setting      TransactionId = transfertable.TransferId     join transfert...