Search code examples
acumatica

Get and Set a field with PXDBLocalizableStringAttribute


I would like set a translate field with PXDBLocalizableStringAttribute type.

For get, I use this syntax:

PXDBLocalizableStringAttribute.GetTranslation(Base.Caches[typeof(PMProject)], row, typeof(PMProject.description).Name,"FR");

In the acumatica documentation, I don't find the set syntax with language : I try this, but the value impact all language.

PXDBLocalizableStringAttribute.SetTranslationsFromMessageFormatNLA<typeof(PMProject.description).Name(cache,row,"FR"+Convert.ToString(row.QuoteNbr),"FR");

I would like use a function to set a value for only one langage. Thanks.


Solution

  • The translation dictionaries screen (SM200540) shows what translations from one language to another. You can set the translation, and then perform the get on the field as you posted, and see if it works. I have also used this method to replace messages that you cannot override.

    For example, "The vendor status is '{0}'." has been changed to "The vendor status is '{0}'. Please contact purchasing to continue."

    This allows the error messages in the multiple modules of Acumatica to all be updated.