My EP site was workingfine but suddenly I have encountered with the error “data or calculated fields with type ‘record’ are not supported” on some of the forms on the EP site. This error is not only coming on the EP site but also while import/export via Excel Addins.

 

The explaination for this as follows : 

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);

}

Advertisements