20
Views
1
Comments
Solved
Internal Error: Cannot convert from 'DateTime' to 'LongInteger (Upgrade/publish)
Question
Application Type
Mobile
Service Studio Version
11.9.1 (Build 33435)
Platform Version
11.9.1 (Build 20359)

Hello,

Please help. We have upgraded our environment from Version 11.0.212.3  to Version 11.9.1  (Build 20359). However, an attempt to publish our Mobile app to the upgraded server fails with the message 'Internal Error: Cannot convert from 'DateTime' to 'LongInteger'. I have attached a text file with all the compiler error detail. 

There is no warning in the app level to show if this is really a conversion being done on the code level so there isn't much help that can lead us to the source of the problem.

Regards,


Shupi.


UpgradeError.txt

Rank: #24245
Solution

You get a Compile error: -Internal Error: Cannot convert from '[Type that cannot be implicitly converted to Long Integer]' to 'LongInteger' when compiling a mobile application with a Local Storage aggregate that has a Count over an attribute whose type cannot be implicitly converted to Long Integer.

You can check the types that can be implicitly converted to Long Integer here: Available Data Types

As a possible workaround (although it needs to be validated on your side):

Created a new calculated attribute to convert the DateTime -> Date -> Text -> LongInteger

TextToLongInteger(DateToText(DateTimeToDate(Localchecklist_response.response_date)))

Created a calculated attribute that was a group by from previous created calculated attribute using the Count function (as the group function)

Published and it was able to compile as expected.