Unable to convert from JsonValue to DateTime filled with Javascript
Similar to Issue #285
on Javascript side:
// adding Date property to object
var data = {};
var adate = new Date("2018-07-11T16:17:18.0000001Z");
data.DateTimeProperty = adate;
Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('OnDateTimeChanged', [data]);
then on al side:
trigger OnDateTimeChanged(jObject:JsonObject)
var
myDateTime: DateTime;
myJToken: JsonToken;
myJValue: JsonValue;
myDateTimeText: Text;
begin
if jObject.Get('DateTimeProperty', myJToken) then begin
myJValue := myJToken.AsValue();
myJValue.WriteTo(myDateTimeText);
myDateTime := myJValue.AsDateTime();
end;
end;
myJValue.WriteTo(myDateTimeText) shows

but myJValue.AsDateTime() generates following Message:

- AL Extension Version: 0.16.19969
- Server Version: Developer Preview – June 2018 hosted by Azure Sandbox
Hello, any news concerning this error? I checked it against the newest developer Preview image bcsandbox:12.3.23590.23945-us and it is still not possible to convert, throwing the same error message.
Hi! Any update on this?
Example string: 2018-10-08T12:00:00Z
AL Extension Version: 2.0.43900 Server Version: BC RTM
Note that this was a server issue so it's bound to not only the extension version but your server version. Thanks again for reporting the issue.
The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from build number 25582.
If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo
For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://blogs.msdn.microsoft.com/freddyk/2018/04/16/which-docker-image-is-the-right-for-you/
The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from build number 25582.
Is this info correct?
I've pulled the latest insider build and it is still not working.
Using image bcinsider.azurecr.io/bcsandbox-master:latest
NAV Version: 14.0.25906.0-W1
AL Version: al-2.0.58805
Hi @kwettermann, please try again in the next coming days, we are still working on this process. The build number above is not directly (yet) correlated to the versions you see, I'm sorry for the inconvenience, we are working on it.
Ah, thank you for the clarification!
Is there any update on this, seems its still not working in the lasted Docker image?