Example Update

Apr 26, 2010 at 6:03 PM

Can you briefly describe how you can update the value of a lookup field using the generated class. Currently it is telling me lookup fields are read only. If you tell me the theory I'll be glad to post my code as a practical example. 

Thanks for taking the time to put this together.

Russell Lindell 

Coordinator
Apr 26, 2010 at 7:28 PM

To update the value of a lookup, use ChangeSelection(int newValueId) method.

For example:
item.AssociateLookup.ChangeSelection(3); 

Hope that helps.

Ilya

Apr 26, 2010 at 7:56 PM
Edited Apr 26, 2010 at 7:59 PM

That's what I needed. When I finish my project, I'll put some sample code up. I'm surprised more people are not talking about this. This has been a huge help with my current project.

Coordinator
Apr 26, 2010 at 8:07 PM
Edited Apr 26, 2010 at 8:09 PM

Russell,

Thank you for the compliment. So far every SP developer I showed this to has been pretty ecstatic and I know of a number of people who constantly use SPDX. I think the reason why more people are not using it, is that I haven't really promoted it in any way. I just wrote the tool for myself and posted it here for others to find and use.

Anyway, I am very glad that you are finding SPDX useful and I am happy I could help with your question. I guess, if you think this is a great tool, spread the word -- put a link to it on your blog and/or suggest it your colleagues. I'd be thrilled if this tool was adopted more.

Good luck with your project.

Ilya