NAV2013 Glance 14: Post Code functionality

Hadn’t read anything about this one, so I stumbled over it too during my exploratory code compare: changes made to the post code functionality.

City field on table 23 (Vendor)

Click on the next image to get a full view that’s readable.

See the newly added TableRelation? And the “removed” OnLookup trigger? The extended ValidateCity “function call”?

Post Code field on table 23 (Vendor)

Click on the next image to get a full view that’s readable.

Modified TableRelation / “Removed” OnLookup trigger / Extended ValidatePostCode “function call”

Country/Region Code field on table 23 (Vendor)

Click on the next image to get a full view that’s readable.

A newly “added”OnValidate trigger

Regarding TableRelation and OnLookup

These changes imply that the lookup in NAV 2013 is now handled by the platform itself and so a dropdown list will be shown:

… instead of a separate window that’s popping up in NAV 2009 and not providing us with the special features of a dropdown list:

Having a closer look at the TableRelation for both City and Post Code field we see that they have the same pattern:

IF (Country/Region Code=CONST()) …
ELSE IF (Country/Region Code=FILTER(<>”)) …

Hence the dropdown list will be filtered according to the value in the Country/Region Code field on the vendor record.

Table 225 (Post Code)

As you might already have sensed from the examples above – see the changes to the functions ValidateCity, ValidatePostCode and ClearFields  – table 255, where these functions reside, has been extended to include both Country/Region Code and County. If my memory doesn’t fail me this addition used to be a localization in Switzerland (CH) and Spain (ES), and probably some other countries, so this is apparently one of the results of MS want to consolidate local features into w1.

The result is that when entering a post code or a city value for the vendor, that is to be found in the Post Code table, the corresponding County and Country/Region Code ( in the Post Code record) will be copied to the vendor.

Now the new function ClearFields and it’s use in the OnValidate trigger of the Country/Region Code field on the vendor table will result in emptying the Post Code, City and County fields when the Country/Region Code field is changed. I am not totally sure if I am happy with that, but I’ll have to try it more to give a final judgement on that.

Note

All the above as explored for the Vendor table does apply to any entity in NAV that has “address” fields defined for.

Leave a Reply

Your email address will not be published.