0

I have a generic list with just title fields. I'm trying to have another list use a lookup column to list each item. If I add the lookup to second list after deployment it works. But if I simply deploy, the lookup is empty.

Here is the lookup field:

  <Field ID="{230bca7f-17b6-4996-be9a-4daa5279c1f7}" Name="RequestComplete" Type="Lookup" List="Lists/ReadyToRunChecklistOptions" ShowField="Title" PrependId="TRUE" DisplayName="Request Approval - Is request completed and approved?" />

I have tried doing it programmatically and declaratively as described here:

http://derekgusoff.wordpress.com/2013/04/26/declaratively-provisioning-a-lookup-column/

Please help.

  • Be careful of the order the deployment actually runs the code. It sounds like the original attempt creates field before ReadyToRunChecklistOptions actually exists. You can also try using an event receivers FeatureActivated and update the lookup field there – user13186 Jul 14 '14 at 15:03
  • How do I control the order that lists are deployed? – farinasa Jul 14 '14 at 15:43
  • Thank you, your comment inspired me to dig in a different direction and I found what I was looking for. Thanks so much. – farinasa Jul 14 '14 at 16:29
  • Just saw your response (sorry for delay), if you need more info I am very familiar with the path I believe you have taken – user13186 Jul 16 '14 at 0:40
0

It is failing because you are deploying the lookup field before the lookup list. The relevant quote from the blog you referenced states:

The trick to doing this right is understanding that the order in which the package deploys the artifacts is important.

Look inside your feature designer, and I bet the element that provisions the lookup field occurs before the list instance. The workaround stated in the blog is to provision the lookup column in the same elements file as the list instance, like this:

enter image description here

  • I had tried this previously with no success. The actual problem was that the list I was referencing was being deployed in a different feature. Somehow, a reference to the feature package GUI wasn't mentioned anywhere in the docs or blogs. I basically stumbled upon it after a while. Anyway, thanks for the response. – farinasa Jul 24 '14 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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