获取并设置具有PXDBLocalizableStringAttribute的字段。

huangapple go评论53阅读模式
英文:

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 impacts all languages:

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

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

英文:

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,&quot;FR&quot;);

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

PXDBLocalizableStringAttribute.SetTranslationsFromMessageFormatNLA&lt;typeof(PMProject.description).Name(cache,row,&quot;FR&quot;+Convert.ToString(row.QuoteNbr),&quot;FR&quot;);

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

答案1

得分: 0

以下是翻译好的部分:

"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."

英文:

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.

huangapple
  • 本文由 发表于 2023年4月7日 04:21:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75953466.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定