Problem with some views in AX 2012 (PRODCALCTRANSEXPANDED)

icemokkaicemokka Member Posts: 7
edited 2011-10-24 in Dynamics AX
Hi,

I'm installing my first AX 2012 (CU1) @ a customer site and stumbled on problem processing the OLAP cubes.

I've followed the error to it's source and appearantly it's a view that won't work ( Data convertion error from nvarchar to string)

In the view PRODCALCTRANSEXPANDED, there is fixed date (N'24/10/2011') that should be converted to DateTime.

First of all, because I'm on a European server with DD/MM/YYYY settings, it writes the date the same in T-SQL. But in T-SQL, it's always MM/DD/YYYY. This is a bug I presume. Setting my server to US dateformat,synschronising the view and the error is gone.

But then I tried to understand the logic of this view, the date is updated every time you do a synchronise of that view. Meaning if you don't synchronise very often and Prodstatus is not 5 or 7, you production-order is not delayed ( DELAYED = 0 ). Why doesn't they use GETDATE() or am I missing something here?

The same for view PRODROUTETRANSEXPANDED, same bug and some illogical use of a fixed date.

This is the piece of code that holds that fixed date in the first view.

CAST((CASE WHEN (((T2.PRODSTATUS) != (5)) AND ((T2.PRODSTATUS) != (7))) AND (T2.DLVDATE < N'24/10/2011')
THEN 1 WHEN ((T2.PRODSTATUS = 5) OR
(T2.PRODSTATUS = 7)) AND (T2.DLVDATE < T2.FINISHEDDATE) THEN 1 WHEN ((T2.PRODSTATUS = 5) OR
(T2.PRODSTATUS = 7)) AND (T2.DLVDATE >= T2.FINISHEDDATE) THEN 0 ELSE NULL END) AS INT) AS DELAYED

T2 is PRODTABLE in this piece of T-SQL.

Any idea's?

Regards,

Sven Peeters

BELGIUM
Sign In or Register to comment.