Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a multi select Lookup column . I have to populate values to the lookup column from another column on a button click. I achieved it using below code but when i try to click ok/save it is throwing error "Invalid Lookup Value" . Please help.

Note : I am doing this only through javascript /javascript client object model

var possible = document.createElement("OPTION");
possible.text = fieldValue[i];
possible.value = i;
possible.selected=true;
tagTarget.options.add(possible);
GipAddSelectedItems(fieldObject)
share|improve this question

2 Answers 2

I think the error says it all, the value which you are adding doesn't come from a lookUp field. If lookup field is binded to some list, within the values like: green, yellow and red. But you try to add 'black' you will get this kind of error.

Or another problem might be that the lookup field isn't binded to a correct source.

I also recommend to check this out: Pull values from a lookup column using SPServices()

share|improve this answer
    
Yeah... Actually the Value i am trying to add is single line of text retrieved from different list ... –  user9167 Jul 26 '12 at 11:03

You need to make sure the look up field is bound to a correct List/field.

I suggest you check and try to add some values manually and see if it works and after try and work out the programmatical approach.

The second thing, you cannot add into look up field just string, it has to be a look up value. So it is not just a string, but a different type of object or it should be an ID of the item. check this out

Just investigate it, as the error says it all, that what you add is not correct value.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.