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 created a custom lookup field inherited from SPFieldLookup. It works exactly like SPLookupField but allows user to add new values. These new values gets added in the Lookup list and becomes available next time in the drop down.

To achieve this, I am first checking the value in lookup list. If value exists then I just return the normal "ID;#Value" otherwise; I first add the new text value to the target list and then return the newly added item's "ID;#Value" pair.

My Field is working fine if I add it in any list where "Folder" is not a default content type. For example, I can create a custom list and add my custom lookup field as a column. It works perfectly.

The problem is with "Discussion Board". In Discussion Board, whenever user enters a new value in custom lookup column, a new item added to the lookup list, as expected, but the content type of new item is always "Folder" instead of normal "Item".

I have tested my field with different types of list but there is no issue with anyone of them except "Discussion Board" list. I don't know why new item automatically becomes "Folder" in Target List, if field is used in "Discussion Board".

Can anybody help? It is very urgent please!!!

share|improve this question
1  
It may help to post some of your code for your custom field, and we can try to reproduce the issue. –  Paul Lucas Apr 8 '10 at 21:43
add comment

3 Answers

Well, there is a specific function for creating Discussions:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.createnewdiscussion.aspx

and a similar one for replies:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.createnewdiscussionreply.aspx

Have you tried looking at this in Reflector? Are you specifying a content type?

share|improve this answer
add comment

Have you tried setting the content type to something else if it is a discussion board? Or, what about changing the ordering of the content types in the discussion board, so that something else is the default?

share|improve this answer
    
Yes, I tried to set "Content Type ID" field specifically to "Item" but no gain. In discussion board "Discussion" is the default type which inherits from "Folder" and I cannot change the default order as it will disturb/confuse the user experience of my site. –  Namwar Rizvi Apr 8 '10 at 12:56
add comment

Look up this link for adding items of a specific Content Type to a list

http://asadewa.wordpress.com/2007/11/19/adding-a-custom-content-type-specific-item-on-a-sharepoint-list/

share|improve this answer
add comment

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.