lookup field dependent column

May 11, 2012 at 4:01 AM

I've successfully created fields, content types, and list instances using SPGenesis. I've also added a lookup column and dependent lookup column in the following way:

list 1


list 2


list 1 title (lookup)

list 1 id (dependent lookup)

I'm now attempting to set up a mapping using SPGenesis entity mapping. The strange thing I'm seeing is that I would expect "list 1 id" to be in integer value (ie: id=1 on query string when opening up editor). But, I'm actually seeing a string value of "1;#1" for the id. Any thoughts? Should I just treat it as string and parse out the bits that I'm interested in?



May 11, 2012 at 4:42 AM

Maybe a few more documented examples of how to use MapField (ie: how to use adapters).

May 15, 2012 at 5:20 PM
Edited May 15, 2012 at 5:20 PM

I changed my approach a little:

1) I have removed the dependent lookup for Id altogether

2) I have now created proper entity / repository for list 1 items

3) when I need to add / remove / clear items from list 2 based on list 1 Id, I first get the entity from list 1, then use the actual lookup value (list 1 title) to key off of. the lookup works fine, and I can perform the required operations

The more I understand Sharepoint, the more I can seem to do with less code! SPGenesis has been a huge help!

Thanks again,