In NAV2009 and earlier, GLOBALLANGUAGE(0) would set the language in NAV to the “default” language of the classic client.
This undocumented feature does not work in NAV 2013 anymore. It will return an error saying:
Exception of type
NavNotSupportedLanguageException' was thrown.
So you must instead set the language ID to the correct value. Use codeunit 43 for this.
With .NET interoperability it is possible to draw inside a NAV 2013 BLOB field. Consider the following snippet of code. “Picture Blob” is a BLOB field. We create a OutStream so we can write information into the blob. We must calc a BLOB field, even if its empty before getting the OutStream.
GenerateBitmap is a function that does the following:
- Creates a Bitmap instance (Size 50×50)
- Creates a Graphics instance on the bitmap
- Creates a SolidBrush in a specific color, in this case from a HTML color code.
- Draws an filled ellipse on the graphics in 0,0 -> 49,49 (bitmaps are 0-indexed)
- Saves the bitmap on the OutStream from our BLOB field.
All variables can be found in the System.Drawing Assembly.
This could be extended so we can draw on a existing BLOB field. So instead of creating a new Bitmap instance, we load the bitmap from an InStream.
And still saves to the OutStream. So you just have to create both the InStream and the OutStream from a BLOB.
One thing I have always missed in Navision/Dynamics NAV is BlobRef. We have RecordRef to access record, FieldRef to access fields (Not BLOB content) and KeyRef to access keys…
So how do we access BLOB content dynamic ?
What I would be 100% content with, are CREATEINSTREAM and CREATEOUTSTREAM methods on a FieldRef and be done with it, but a full blow BlobRef implementation would also work..
Or am I missing a way to do this ?