Skip to main content

I am trying to search for an item in a list by using Sharepoint Search wizard. In the wizard it asks to save the searched item in a content field (created with a content Type List Items).


If an item exists and is searched, is saved in the content field and then can be accessed using its ID, but if the item does not exist then the ID field of the content field returns a stringg] instead of 0.


I am checking this further in a line rule where I check content field ID. I guess it should be zero if there is no item searched, or otherwise it should return some ID.


In the error log it gives error as "Invalid cast from 'System.Int32' to 'System.Stringg]' "


Please Help.

Ok this is resolved. The content type that we used to fetch and store value can be initially set to 0. If after search wizard, it contains any value other than 0 then the process will proceed otherwise if it contains 0 that means item doesn't exist in the searched list or library.


Reply