CustomFieldCodeValueDoesNotMatchLookupTable updating Custom Field RRS feed

  • Question

  • Hi all,

    I´m trying to update a CustomField with Lookup using the next code:

    publicGuidGetLookupFieldUIDByLookupValue(SvcLookupTable.LookupTablelf, stringLTName,stringLTValue, PSLibrary.Filter.SortOrderTypeEnumsortOrder)
    LookupTableDataSetd = lookup.ReadLookupTables(string.Empty, false, 1033);
    foreach(SvcLookupTable.LookupTableDataSet.LookupTableTreesRowx ind.LookupTableTrees)
    if(x.LT_VALUE_TEXT == LTValue && x.LookupTablesRow.LT_NAME == LTName)


    So, when I find the code value to a determinate Value, I insert the value returned for that function like this: CODE_VALUE =(GetLookupFieldUIDByLookupValue)

    The problem is coming apparently random to get this error when the function QueueAddToProject is used with the error as the title of this thread says: CustomFieldCodeValueDoesNotMatchLookupTable.

    Thanks in advance!

    Miguel Soler

    Tuesday, February 14, 2012 12:00 PM

All replies

  • As the error says CodeValue is not from the Lookup Table you're using. Can you show the other code, that is, just before

    CODE_VALUE =(GetLookupFieldUIDByLookupValue)

    How you're assigning IDs.


    Thanks, Kashif

    Tuesday, February 14, 2012 8:14 PM
  • As I explained above is how is retrieved the CODE_VALUE, needed to the Custom Field of a Lookup Table.
    Normally it works, but for some values not.

    The Value exists at the Lookup table because this  code return the value

    if(x.LT_VALUE_TEXT == LTValue && x.LookupTablesRow.LT_NAME == LTName)
    return x.LT_STRUCT_UID
    Has anyone experienced that?


    Miguel Soler

    Tuesday, February 14, 2012 8:44 PM