Clearing multi -language descriptions when copying an object

The user can clear the descriptions when a user copies an object to a new code, the multi-language descriptions are copied.

The RemoveMultiLanguageValues() script function can be used in copy methods scripts to clear out translated free text that is not relevant to the new object.

The syntax for the new function:

RemoveMultiLanguageValues(objectSymbol As String, objectKey As String) As Integer
RemoveMultiLanguageValues(objectSymbol As String, objectKey As String, fieldNames As List(Of String)) As Integer
RemoveMultiLanguageValues(objectSymbol As String, objectKey As String, fieldNames As List(Of String), languageCodes As List(Of String)) As Integer

The objectSymbol and objectKey arguments can be sent a blank to indicate that the current object must be used.

The fieldNames and languageCodes arguments can be sent an empty list to indicate that all fields and all languages must be removed (except for the current language). A null list for either argument results an error.

The fieldNames argument can be sent a mixed list of FIELD_NAME values or DB_FIELD_NAME values from FsValidationField.

This returns the number of multi-language rows removed during this call. Returns -1 if the target object is not found.

If the fieldNames or languageCodes lists contain either fields that don't support multi-language or language codes not defined in Optiva's configuration an error message is displayed.

  • Remove all multi-language rows for all supported fields, in all supported languages:

    Dim rc As Long = RemoveMultiLanguageValues("", "")

  • Remove all multi-language rows for the Description and Comment fields, in all supported languages:

    RemoveMultiLanguageValues("", "", New List(Of String) From {"DESCRIPTION", "COMMENT"})

  • Remove all multi-language rows for the Description field, for the Greek language:

    RemoveMultiLanguageValues("", "", New List(Of String) From {"DESCRIPTION"}, New List(Of String) From {"EL-GR"})

  • Remove all multi-language rows for all supported fields, for the French language:

    RemoveMultiLanguageValues("", "", New List(Of String), New List(Of String) From {"FR-FR"})