Comparing .NET values

  • Post comments:2 Comments

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…

Continue Reading Comparing .NET values

Automatically Confirm cmdlets

  • Post comments:4 Comments

Some NAV PowerShell cmdlets (such as Import-NAVApplicationObject) don’t have the -Force switch, and always ask for confirmation regardless of whether you include the -Confirm switch or not. To work around…

Continue Reading Automatically Confirm cmdlets

Formatting for XML

  • Post comments:3 Comments

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…

Continue Reading Formatting for XML

Do you have a value, Mr. BLOB?

  • Post comments:7 Comments

To check if a BLOB field has a value, you call its HASVALUE function. For example: IF Item.Picture.HASVALUE THEN; In older versions, earlier than NAV 2009, you had to call…

Continue Reading Do you have a value, Mr. BLOB?