Check out the latest Business Central updates!Learn about the key capabilities and features of Dynamics 365 Business Central and experience some of the new features.
Download overview guide | Watch Business Central video
2019 release wave 2 Discover the latest updates and new features to Dynamics 365 planned through March 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
Is there a more comprehensive AL Language reference available than the one at MSDOCs?
I'm attempting to code around this issue:
And would like to know if there are any inbuilt functions in AL to cast columns to other data types.
Any help much appreciated.
What do you mean with "comprehensive AL language reference"?
Your problem listed here seems related to the OData component you're using. A Date field in D365BC is a Datetime under the hood (SQL level). Please try to remove the caption in the query (maybe it's a problem of field name?).
Sorry - that wasn't meant to sound like a complaint.
I've been looking here as a source: docs.microsoft.com/.../devenv-programming-in-al
If I take the api query object as an example:
The caption property:
Is, as far as I can tell, a mandatory field (if I omit it the package compiles and publishes, but goes to an error page). The doc doesn't mention this.
Maybe it's a function of the language being relatively new - or devs having come over from nav / CSIDE (which I've never used) - but there seems to be lack of reference material. Again - not a complaint - just struggling to find the answers and wondering if there is another source developers are using.
For the data type issue. My understanding was that the OData component picks up the expected datatypes from a metadata call first? I can't remove the caption. I can't see that I can convert the data type (explicitly cast it as a DATETIME).
If it's a full date time (i.e., has both data and time values) then it works fine. But '2019-12-10 00:00:00' would throw an error. And '1792-01-01 08:21' would also throw an error.
Caption is not mandatory (recommended, but not mandatory). When you publish an object as an API page a caption should always be placed in camel case notation (for example modifiedDate instead of "Modified Date").
I mention caption because there are some third party OData components that has problems with OData fields not in camel case format.
I've never see a problem like yours, Datetime fields in a query and with Odata works without problems (I've lots of Odata components that do that).
Great - I hadn't clocked the camel case requirement - I'll give that a go. Thanks!
Unfortunately this didn't make a difference.
Data like the below, with all three being DateTime in the source:
With a column on the API page setup like this:
So I'm wondering if it's possible to explicitly cast columns in the query object code?.
For reference, I found blog.steveendow.com/.../microsoft-dynamics-365-business-central.html to be of enormous benefit.
Business Applications communities