In NAV 2013 R2, if a RecordRef does not have a active record, CURRENTKEYINDEX will return -1. IN NAV2009 and older, the value was 1 (As the number of the primary key).
If the value of CURRENTKEYINDEX is given to KEYINDEX – a index out of bounds error will occur.
This is not documented in the NAV 2013 R2 help.
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.