Options

How to show language dependent text in a Table Box?

munsonmunson Member Posts: 4
Hi,

I have a Table Box that consist of name/value pairs (two columns) and I need to show the name column in the table in different languages depending on the users language. Normaly (in VB6, .NET, basically anything other than Navision) I have a ID column for the name and I exchange that with the values stored in a lookup table in my SQL statment that fetch the data and bind to the resulting RecordSet or DataSet to the grid.

Is there any way in Navision to show a column from another table in a Table Box than the one defined in SourceTable? Is there some other way to make the content of a column be translated to the language in use?

Comments

  • Options
    jhoekjhoek Member Posts: 216
    Please keep in mind that the SourceExpr(ession) for a text box does not absolutely need to be a field in the SourceTable: any expression that evaluates to a type that the tablebox/textbox controls can display will do.

    If I understand you correctly, you want to build a form that looks a bit like the Properties window in C/SIDE, but with language-dependent property names. I think I'd write a function in the SourceTable that retrieves the left-column value from a table with translated descriptions, and use that function as the SourceExpr for you left-hand column text box.
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • Options
    munsonmunson Member Posts: 4
    Thanks jhoek, what you are suggesting seem to be the perfect solution to my problem. I Appreciate the quick anwser!
  • Options
    DenSterDenSter Member Posts: 8,304
    I think I am missing something, but can't you use the CaptionML property for this? For the standard app, there should be files wth all the known captions, but for custom fields you can enter the translations of the field caption in the CaptionML field property.
  • Options
    jhoekjhoek Member Posts: 216
    I believe the original question is about "ML-enabling", not field names?!

    Imagine the Properties window in C/SIDE supporting property names in the current application language - that's the effect that munson is trying to achieve, if I'm not mistaken.
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • Options
    jhoekjhoek Member Posts: 216
    Another suggestion: if the names in the name/value-pairs are known, you could make the Name column an option field, and insert a record in the table for each option in the field. Doing it like that, you'll benefit from the fact that option fields can be made ML-enabled by setting the OptionCaptionML property.
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • Options
    DenSterDenSter Member Posts: 8,304
    Oh ok, so instead of having one value with different language field captions, you have different records with different names AND values. Can't you simply add a language column and filter on the user's language?
  • Options
    jhoekjhoek Member Posts: 216
    I think each line represents one value (just like the Properties window), whose name can be presented in a number of languages, but always in one language at a time. The value will probably remain the same, regardless of the language chosen. That's why I believe you should have one record for each name/value-pair, and change only the presentation of the name if the user switches to another language.

    So:

    Column "Name": Height
    Column "Value": 20

    or

    Column "Name": Hoogte
    Column "Value": 20

    or

    Column "Name": Hoehe
    Column "Value": 20
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • Options
    munsonmunson Member Posts: 4
    I must admit that jhoek is better at explaining what I want to do than I am :)

    I have implemented his first suggestion with using a function in the SourceExpr and it works just as I wanted. Another good thing about that solution is that it keeps the amount of data down since it does not store the same texts over and over. I will stick to this solution.
  • Options
    DenSterDenSter Member Posts: 8,304
    So in order to link the word 'hoogte' to the language Dutch as opposed to the word 'hoehe' to German, you need to have a way to do that. I am curious to know if not in a field that designates the language of the "name" column, how are you going to do that then? How does the system know to display the word 'hoogte' when it determines that the user has their computer set up to be Dutch?
Sign In or Register to comment.