Invalid Language ID Supplied: 0 Error
Another day another bug on update 15.4.41023.41345. One of our clients was having problem printing the invoice. The error said “Invalid Language ID Supplied: 0 Error”.
The issue came from the LanguageCU. It does not accept blank Language Code anymore.
CurrReport.Language := LanguageCU.GetLanguageId("Language Code");
To fix the issue, I could either remove the code completely or just add an if statement.
IF "Language Code" <> '' then
CurrReport.Language := LanguageCU.GetLanguageId("Language Code");
This morning I found out that revalidating the Windows Language ID in table Languages fixed this problem. Hope this helps.
If an empty language code can be expected, you can just use GetLanguageIdOrDefault() function from the same language CU instead of the GetLanguageId() one.