RemoveMultiLanguageValues

You can use the RemoveMultiLanguageValues function to remove language-specific values from one or more fields in an Optiva object. The function clears multilingual translations for all languages or specified language codes.

You can use this function when copying an object to a new code and clearing existing translations for a new Description or other translated field in the Create Rule or Wizard.

When to use

You can use this function to:

  • Remove multilingual translations from object fields.
  • Remove obsolete or incorrect translations.

Syntax

Syntax 1
Remove All Languages for Specified Fields
int RemoveMultiLanguageValues(string objectSymbol, string objectKey, List<string> fieldNames)
Syntax 2
Remove Specific Languages for Specified Fields.
int RemoveMultiLanguageValues(string objectSymbol, string objectKey, List<string> fieldNames, List<string> languageCodes)

Parameters

Parameter Type Required Description
objSymbol string Yes

The symbol of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
objKey string Yes

The key of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
fieldNames List No The list of field names for which multi-language values should be removed.
Note: If The value is null or empty, the multi-language values for all supported fields are removed.
languageCodes List No The list of language codes. For example, "FR-FR", "DE-DE", "ES-ES" specifying which languages to remove.
Note: If omitted, all the languages are removed.

Return Value

The application returns a value greater than zero (0) if the operation is successful.

Impacts

  • The changes are immediately persisted to the database.
  • The base language values, typically EN-US, can remain unchanged.
  • The operation cannot be undone without database restoration.

Prerequisites

The language codes must be valid and supported in the system.

Examples

Example 1
RemoveMultiLanguageValues("", "");
Description
This examples removes the multi-language values for all supported fields for the current object on which workflow is launched.
Example 2
List<string> fieldlist = new List<string>();
	fieldlist.Add("DESCRIPTION");
	RemoveMultiLanguageValues("ITEM", "00551", fieldlist);
Description
This example removes the multilanguage values for the field 'DESCRIPTION' in the Item 00551.
Arguments
  • objectSymbol - ITEM
  • objectKey - 00551
  • fieldNames - Field names are passed through the list 'fieldlist'
Example 3
	List<string> fieldlist = new List<string>();
	fieldlist.Add("DESCRIPTION");
	List<string> languageCodes = new List<string>();
	languageCodes.Add("FR-FR");
	languageCodes.Add("DE-DE");
	RemoveMultiLanguageValues("ITEM", "00551", fieldlist, languageCodes);
Description
This example removes the multi language values for FR-FR, DE-DE of the field 'DESCRIPTION' in the Item 00551.
Arguments
  • objectSymbol - ITEM
  • objectKey - 00551
  • fieldNames - Field names are passed through the list 'fieldlist'
  • languageCodes - Language codes are passed through the list 'languageCodes'