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");

thatnavguy

Experienced NZ-based NAV Developer and Consultant with 15+ years of experience leading multiple IT projects, performing business analyst, developing, implementing, and upgrading Dynamics NAV and Business Central. Passionate to deliver solution that focuses on user-friendly interface while keeping high standard of compliance with the needs.

You may also like...

2 Responses

  1. This morning I found out that revalidating the Windows Language ID in table Languages fixed this problem. Hope this helps.

  2. anon says:

    If an empty language code can be expected, you can just use GetLanguageIdOrDefault() function from the same language CU instead of the GetLanguageId() one.

Leave a Reply

Your email address will not be published. Required fields are marked *