EcoResCategory::findNonExistByString Method
Finds the first String value so that in the table that is specified by the value of the _tableId table, there is no existing record with the _matchingFieldId field's value matching the specified value of the _matchingFieldValue parameter, and the _strFieldId field's value that matches the String value found.
Syntax
client server public static str findNonExistByString(
TableId _tableId,
FieldId _matchingFieldId,
anytype _matchingFieldValue,
FieldId _strFieldId,
ExtendedTypeId _strFieldType,
str _strValueExactMatch,
str _strValueFormatter,
[RecId _excludedRecId])
Run On
Called
Parameters
- _tableId
Type: TableId Extended Data Type
The ID of table to search.
- _matchingFieldId
Type: FieldId Extended Data Type
The ID of field in the table to match.
- _matchingFieldValue
Type: anytype
The value with which to match the value of the _matchingFieldId field.
- _strFieldId
Type: FieldId Extended Data Type
The ID of the String field in the table to match.
- _strFieldType
Type: ExtendedTypeId Extended Data Type
The ID of the extended data type of a String field.
- _strValueExactMatch
Type: str
The exact value with which to match the _strFieldId String field.
- _strValueFormatter
Type: str
The formatter for the value to match the _strFieldId String field.
- _excludedRecId
Type: RecId Extended Data Type
The record ID to exclude in search for non-exist name.
Return Value
Type: str
The first string value that does not match the string field of any existing record in the table.
Remarks
For example, if
the table is EcoResCategory ,
the _matchingFieldId is CategoryHierarchy,
the _matchingFieldValue is 12345678,
the _strFieldId is Name,
the _strValueExactMatch is "New Node",
the _strValueFormatter is "New Node # %1",
the _excludedRecId is 87654321,
then,
If the EcoResCategory table, excluding 87654321, has no record with CategoryHierarchy=12345678 and Name="New Node", the return value would be "New Node".
If the EcoResCategory table, excluding 87654321, has no record with CategoryHierarchy=12345678 and Name="New Node # 1", the return value would be "New Node # 1".
If the EcoResCategory table, excluding 87654321, has no record with CategoryHierarchy=12345678 and Name="New Node # 2", -- return value would be "New Node # 2".
An exception is thrown if we cannot find one after exhausting all possibilities.
The formatter should take one argument, which will be replaced by an integer starting from 1 and incremented by 1 when searching for non-match.