Plataan - Microsoft Dynamics - Learning & Competence Management Vincent Bellefroid Koen Stox Steven Renders Conny Schuddinck Steffie Alexiou
A blog about Microsoft Dynamics
Home Archives Subscribe Plataan website

« The importance of accounting periods in fixed asset depreciation | Main | Noisy Van »

07/10/2008

The CaptionClass property

Not so long ago we were investigating a strange problem with a report. Every time the report was run, the label of one of the fields on a section was not printing what it was supposed to print according to its Caption/CaptionML property, or according to the Caption/CaptionML property of the related field in the table it was linked too. Somehow, something was dynamically changing the label???

After a while we suddenly noticed that the property CaptionClass was filled in, in the properties of the field in the table, and this was the cause of this 'strange behavior.

So, how does this CaptionClass property works?

If the CaptionClass property of a field or a control is defined, the function trigger CaptionClassTranslate (ID 15) in Codeunit 1 (ApplicationManagement) is called by the system every time the field or control is shown. The purpose of this function is to replace the caption, as defined in the design of the field or control, with another string.

2 parameters are passed to this function:

  • LANGUAGE

    The LANGUAGE parameter is automatically mentioned by the system as is the Windows Language ID of the active language in Navision.
    If the active language in Navision is English (United States), LANGUAGE will hold the value 1033.

  • CAPTIONEXPR

    The CAPTIONEXPR parameter holds the content of the CaptionClass property of the field or control.

In a way, the function trigger CaptionClassTranslate (ID 15) is a system trigger:

This standard code analyzes and unravels the CaptionExpr parameter. This parameter has the following syntax:

  • CAPTIONEXPR := <CAPTIONAREA>,<CAPTIONREF>

Depending upon the value of the CAPTIONAREA, different procedures are called. Either:

  • DimCaptionClassTranslate(Language, CaptionRef)

    or

  • VATCaptionClassTranslate(Language, CaptionRef)

This is the way the standard functionality in Dynamics NAV deals with the CaptionClass property. Every field or control with a defined CaptionClass has a string in this property with the syntax described earlier.

The following diagram illustrates this sequence:

So, knowing this and with a little bit of imagination, you could extend the code in the CaptionClassTranslate trigger to be able to dynamically translate/change labels in Dynamics NAV.

Comments

The comments to this entry are closed.

October 2011

Mon Tue Wed Thu Fri Sat Sun
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Plataan Community

Visit us on LinkedIn Visit us on Facebook Visit us on Twitter