Question Status

Suggested Answer
Beat Pallagi asked a question on 12 Dec 2012 6:00 AM

I used the Add Data - Add Tables in the Excel Add-in and choosed a table and pressed ok. Then i got that error [Exception occurd on the metadata service on client or server. See exception details below: >Data or calculated fields with type 'Record' are not supported.]. As stated in the error i checked the fields and display methods of that table, but none of them use Record type. Any Idea?

Reply
Suggested Answer
ARPIT CHAVHAN responded on 25 Mar 2013 11:37 PM

Dear All,

I was getting an error as "Data or calculated fields of type 'Record' is not supported" while starting the EP site also when doing excel import via excel addins.

This type of error comes when you return a record of a table,as in display type on some table.

In my case it was HCMWorker which was a standard table and we had written a display method which was returning record of HcmEmploymentDetail table which does not supported by AX during run time.

display HcmEmploymentDetail retHcmEmploymentDetail()

{

   ;

            return HcmEmploymentDetail::findByEmployment(HcmEmployment::findWithWorker(this.recId).RecId);

}

the above query is not supported by AX during run time.

What I found out that, if you want to return any record of a table it should be static method as in.....

public static HcmEmploymentDetail retHcmEmploymentDetail(HcmWorkerRecId      _recId)

{

   ;

   return HcmEmploymentDetail::findByEmployment(HcmEmployment::findWithWorker(_recId).RecId);

}

Reply
Mansoor Adeel responded on 12 Dec 2012 9:39 PM

Hi Beat,

Excel Add-In have issues for data import, If you need to import bulk data, you may use Microsoft Data Migration Framework, its an easy to configure and easy to use even for complex table structure. I have prepared a blog to share after successful data import using DMF, you can check at following location:

dax2012dmfdataimport.blogspot.com

There two posts, in one I have described how to install and import using DMF and in second post I have detailed how to prepare a custom CSV file for import.

Its faster than Excell Add-In.

Mansoor Adeel

Mansoor Adeel

AX 2012 Techno Consultant

Reply
Beat Pallagi responded on 12 Dec 2012 11:26 PM

Hi Mansoor,

Thank you for your replay. It's not about data import. I'd like to use the Excel Add-in for data analysises purpose, as a selfs service BI, where no Developer is needed to provide Queries or Cubes.

Beat

Reply
Mansoor Adeel responded on 13 Dec 2012 1:56 AM

Hi Beat,

Which table you are trying to import in Excel?

Mansoor Adeel

Mansoor Adeel

AX 2012 Techno Consultant

Reply
ARPIT CHAVHAN responded on 19 Mar 2013 11:02 PM

Hi Beat,

Have you found any solution for the above given errror. If yes, please let me know as I am facing the same error.

Thanks & Regards.

Reply
Beat Pallagi responded on 20 Mar 2013 12:59 AM

Hi ARPIT

Unfortunately we have not found any solution to this particular problem. The, let me say 'strange' thing is, that it worked on a different installation (same application version). So this behaviour some how stopped me investigating into more details as it was not clearly pointing to X++/MorphX. Additionally it was on a table we created by our own - it has several array fields. But in the end, sorry can't tell you what to do.

br

Beat

Reply
ARPIT CHAVHAN responded on 21 Mar 2013 12:21 AM

Thanks Beat for replying..

May I know any other way around to do this if any....

Reply
Sameer Gurav responded on 22 Mar 2013 9:20 PM

Arpit...Please help Us !! If any Update !

Reply
ARPIT CHAVHAN responded on 23 Mar 2013 2:35 AM

Hard luck dude....Still struglling...

Reply
Brandon Ahmad responded on 23 Mar 2013 6:30 PM

Hmmmm..  So, AX is reading a record as type Table, Map, or View and can't convert it with the CIL because it can't  figure out one of the field's type...   very interesting. Can you paste the datasource types that were used?    

That would have been easy enough to solve.  We just would have needed to look at the datasource field types and figure out which one wasn't being read into a .NET type.  You could do that through debugging or by just removing field by field and attempting the import/export operation until it succeeds. You would know the bad field type when you remove it and the import/export operation works.  I suspect that this will be the cause of some of the problems, but not everyone's problem.  

But something else threw me off on this one...  The fact that it wasn't happening in all environments...  Tricky..  Months ago, I remember reading about how the new 2012 AX framework could cause inconsistent behavior with Arrays across tiers!  Shoot..  now, the metadata is involved in it.  Check this blog post and then follow the instructions on how to debug in interpreted mode as you click the Excel Add-in and go through the process.  

blogs.msdn.com/.../x-arrays-behave-differently-in-net-cil-in-dynamics-ax-2012.aspx

Remember that Dynamics AX is a weakly TYPED system, which means that the compiler won't catch certain errors and they will blow up at runtime.  

I had not seen this variant of the Excel-Addin error, but I would start here if I were troubleshooting.  Knowing that you have an incompatible typing error will help you look for a lot.  

Also, a ton of 2012 errors were fixed with a full recompile (that has a lot to do with the AX 2012 way of processing an Excel command as opposed to the 2009 way), but I would debug the process first.    

This isn't an answer, but I hope that it will get you on the right track.  

Independent, Freelance Consultant and Dynamics Development Instructor

http://www.instructorbrandon.com

http://www.youtube.com/user/BrandonAhmad

Reply
Suggested Answer
ARPIT CHAVHAN responded on 25 Mar 2013 11:37 PM

Dear All,

I was getting an error as "Data or calculated fields of type 'Record' is not supported" while starting the EP site also when doing excel import via excel addins.

This type of error comes when you return a record of a table,as in display type on some table.

In my case it was HCMWorker which was a standard table and we had written a display method which was returning record of HcmEmploymentDetail table which does not supported by AX during run time.

display HcmEmploymentDetail retHcmEmploymentDetail()

{

   ;

            return HcmEmploymentDetail::findByEmployment(HcmEmployment::findWithWorker(this.recId).RecId);

}

the above query is not supported by AX during run time.

What I found out that, if you want to return any record of a table it should be static method as in.....

public static HcmEmploymentDetail retHcmEmploymentDetail(HcmWorkerRecId      _recId)

{

   ;

   return HcmEmploymentDetail::findByEmployment(HcmEmployment::findWithWorker(_recId).RecId);

}

Reply
Sameer Gurav responded on 25 Mar 2013 11:40 PM

Thanks a Lot for the Solution !!!

Reply