Share via


MCRCustCategory::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 _matchingFieldIdfield's value matching the specified value of the _matchingFieldValueparameter, 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

  • _matchingFieldValue
    Type: anytype
    The value with which to match the value of the _matchingFieldId 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.

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,

  1. If the EcoResCategory table, excluding 87654321, has no record with CategoryHierarchy=12345678 and Name="New Node", the return value would be "New Node".

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

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

See Also

Reference

MCRCustCategory Table