Category Archives: Uncategorized

Webinar: Invoking Azure Functions from AL in Visual Studio Code

Long time, no see, eh? Life and work sometimes kick in and that’s exactly what they did to me recently. I am not complaining, but I would have been happier, too, if I had been more active here.

Now that I am, in fact, here, let me announce the Invoking Azure Functions from AL in Visual Studio Code webinar that I will deliver next Tuesday, August 29, at 16:00, Central European Time.

This webinar, which is organized in cooperation with NAV-Skills, will cover the theory I scratched in my last blog post here, but will cover some more stuff. On top of a little more substance and structure than covered in my blog, it will also give you an opportunity to ask questions and make fun of me in front of an audience. Last opportunity for this before Directions US Smile

So, grab your seat by registering here. It’s free, but even if it wasn’t, you should still be there. Don’t let me find you absent, you are not excused! Smile

See you in the cloud!

Long time, no see

Time flies, eh? It seems you folks have been busier here on my blog than I was. Four months whooshed by since I last posted something here, and I have been so busy that it seems like a week.

Today I decided to use my last hours in Phoenix, Arizona, after a successful Directions US and before my flight back home to Croatia, to post my impressions of the conference together with the content from my session, but then I realized I had quite some work to do to approve and reply on comments.

So, that’s what I am up to now. Thank you all who commented and patiently waited for me to turn up here to do what bloggers should do regularly. I am sorry, I’ll try to not make it happen again.

And then, when I am done, I’ll post the stuff I promised to post, so – stay tuned.

Comparing .NET values

When comparing .NET variables, including Enums, you cannot use C/AL comparison operators. To compare .NET variables, you must use the Equals method (of the System.Object type) that all .NET types implement or inherit. So, instead of IF var1 = var2, or IF var1 = var1.EnumValue (in case of an Enum), just write IF var1.Equals(var2), or IF var1.Equals(var1.EnumValue).

I see this mistake often being made or attempted by developers, even though it has been documented inside .NET Interoperability documentation since it was introduced with 2009 R2.

Careful with Microsoft.Dynamics.NAV JavaScript object

Make sure that you don’t access the Microsoft.Dynamics.NAV JavaScript object before the document ready event fires. If you do so, you might experience problems on Chrome when the user refreshes the browser (F5). It appears that on refresh Chrome loads (and runs) scripts in different order, and depending on how complex scripts included in your project are, your code might get executed before Microsoft’s script is loaded, and it will cause nasty script errors. This occurs only on Chrome on PC.

Formatting for XML

When you have to format C/AL variables (numbers, dates/times, booleans) for exchange with other apps, call FORMAT(variable,0,9) instead of simply FORMAT(variable). The format 9 formats the variable according to XML standards, and this value can then be interpreted correctly on any system with any regional settings. This is useful also when passing string-formatted values from C/AL to C# or JavaScript.