Tuesday, November 27, 2012

Wrong Sharepoint lookup value


You might not get an error but you might end up with a wrong lookup value.


During data migration when associating source item lookup value to the target item lookup value directly. Please ensure that the lookup Id is the same for the source lookup value and the target lookup value, as it assigns whatever value is associated with the lookup Id got from the target side. This is fine as long as both the side’s lookup value has the same Lookup Id if not you will end up with a wrong value.


As each lookup value’s Id is auto generated from its lookup master list. There are chances of id mismatch between the source side and the target side when items are deleted and entered repeatedly without uniformity.


So please check your source and destination master lookup lists value-id association if you are facing a similar issue.

Code logic solution for above scenario:

Get the lookup value from the source item and query the master lookup list associated with the current lookup field and get the item id and associate it to your SPLookFieldValue.

No comments:

Post a Comment