Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

In my solution, I have a table that lists all possible errors, and each of them have a unique ID like ERR001.

I have another file containing a dictionary table with global fields that corresponds to the error messages and are filled according to the language of the user. For example, this table has a field ERR001 that will contains the message to be displayed when error number 1 occurs.

I would like to have a field in the Error table that is the error message from the correct Dictionary field, based on the ID of the error record.

What I would like to do is something like D::$ID, where D is the Dictionary table and $ID is the ID of the error.

I tried using getField but I could not make it work using a reference in another file.

 

Any tips would be appreciated

I don't understand your description - esp the part about global fields. IMHO, you should have either:

  • a table where each unique ErrorID is a record, and there is a field for each language containing the message in that language;

or (preferably, IMHO):

  • a table where each message is a separate record, with fields for ErrorID, Language and Message.
  • Author

Thanks for the answer. I will note these answer for further development, but in my current project I really have to use a file that have the messages as fields. Can you think of any other way I could achieve it ?

Here more description:

I have a table that contains error messages in different fields. I can only add fields for additional messages in this table.

The second table, in a separate file, contains a record for each error. I would like to add a field to this table that would reference the correct field in the other table using its name.

I know this is not the preferred architecture but I have to work this way. The reason is that all displayed message have to be in a table that has a record for each language so we can easily add new languages

Any ideas ?

I am afraid I still don't follow this. Let us have a simple example:

ErrorID    Language    Message
ERR001     English     User canceled action
ERR001     French      L’utilisateur a annulé l’action
ERR002     English     Memory error
ERR002     French      Erreur de mémoire

How exactly would this be represented in your Dictionary table?

Next question: what relevant fields are in the target table, and what would they contain for the purpose of this example?

 

26 minutes ago, Anthony said:

The reason is that all displayed message have to be in a table that has a record for each language so we can easily add new languages

I don't think that's a good reason to have a flawed structure. On the contrary, you'll find it easier to add new languages and new error codes if your structure is normalized: i.e. a table of codes, a table of languages (optional) and a table of messages.

 

 

Edited by comment

  • Author

So the dictionary would look like this if the user selected English as his language:

ERR001                 ERR002          ERR003

User canceled action   Memory error    Device disconnected

This table contains only global fields and there is a script that load the values according to the chosen language (There is another table containing the same messages, one record for each language, but we should not have to deal with it).

The error table with relevant fields:

ErrorID       Description                             Message

ERR001        Occurs when action is cancelled         User canceled action

ERR002        Occurs when the user's machine...       Memory error

ERR003        Occurs when the device is ...           Device disconnected

25 minutes ago, Anthony said:

This table contains only global fields and there is a script that load the values according to the chosen language

I am convinced you are going about this the wrong way, and making it much more complicated than it needs to be.

As an exercise only, here's a file that shows how to get "the error message from the correct Dictionary field, based on the ID of the error record" as you originally asked.  But I would strongly recommend against using this method.

 

 

Dict.fp7

  • Author

Thanks for the file, it does exactly what I was looking for. I do will review the way the dictionary work.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.