October 09, 2014

ValidTimeStateFieldType Property on Table- AX 2012 R2, R3

ValidTimeStateFieldType Property on Table- AX 2012 R2, R3

What is the use of “ValidTimeStateFieldType” property on table

Date effective data is tracked in a table that has its ValidTimeStateFieldType changed from its default value of None. Also, an index with its ValidTimeStateKey set to Yes must be added on the table. The system automatically adds the fields named ValidFrom and ValidTo to the table, which will be of type date or utcdatetime. The system automatically prevents overlap between the date ranges in these two fields among rows that track the same entity.

clip_image001

clip_image003

How to fetch records from this type of tables

The following code sample returns the records that are effective during 1/1/2001 and Current date:

static void theAxapta_ValidTimeState (Args _args)

{

vendTable vendTable;

TaxRegistration TaxRegistration;

DirPartyLocation DirPartyLocation;

date ToDate = today();

date FromDate = 01\01\2001;

while select validtimestate(fromdate, ToDate) * from TaxRegistration

join DirPartyLocation

where TaxRegistration.DirPartyLocation == DirPartyLocation.RecId

{

select vendTable where vendTable.Party == DirPartyLocation.Party;

info(strfmt(“%1”, VendTable.Name));

}

}

For more details

http://msdn.microsoft.com/en-us/library/gg861781.aspx

White papers

http://download.microsoft.com/download/4/e/3/4e36b655-568e-4d4a-b161-152b28baaf30/using_date_effective_patterns_ax2012.pdf

http://www.microsoft.com/download/en/details.aspx?id=20864

 

-Harry

September 17, 2014

Finding the current accounting currency code through X++ code

Hi Guys ,

Just sharing small trick to pull the current accounting currency through X++ code

here are three way to pull current currency,
1. currCode = Ledger::accountingCurrency(CompanyInfo::current());
2. currCode = Ledger::accountingCurrency(CompanyInfo::Find().recid);
3. currCode = CompanyInfo::standardCurrency();


Thanks-
Harry

September 08, 2014

Error while compiling the project after import

Error: After import a new project from another server, while compiling system gives below error message:


AX1004: Reference System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 was not a valid model assembly.
\C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll

Warning Message:

MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or
\C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets
Line: 983

image

Possible Reason:

It might be your .net version.

Solution:

Install .net version 4 from below link

http://www.microsoft.com/en-us/download/details.aspx?id=8279

After installing this update this error should not come.

-Harry

September 02, 2014

Error while deploying SSRS report in Dynamics AX 2012 R3- An error occurred : The network path was not found. If User Account Control (UAC) is enabled on the machine, close the application, right-click the application, and then click Run as administrator.

Hi Folks,


Below are troubleshooting for Error while deploying SSRS report in Dynamics AX 2012 R3

clip_image001

Error 1:
The deployment was aborted. You do not have privileges to deploy to server: ######. For deployment, you must have administrative rights to the SQL Server Reporting Services (SSRS) server. Contact your administrator to deploy.

Error 2:
An error occurred: The network path was not found. If User Account Control (UAC) is enabled on the machine, close the application, right-click the application, and then click Run as administrator.

Solution:

Go to services-> Remote Registry and change the start type to automatic. And start the service.

clip_image002

Now deploy your report, it should deploy successfully.

clip_image003


Hope this will help you. Keep sharing your feedback under comment box. 
-Harry