I've got several list which have lookup fields, and I can't add new items to any of them. Every time I've clicked save, I get this error:
"Invalid data has been used to update the list item. The field you are trying to update may be read only."
None of the fields are set to read only. I've built the list "manually" by creating the XML files longhand in VS, but all those without lookup fields work fine. I've tried adding data manually by populating the element in the list instance, but I don't know how to properly do the lookup field.
Any ideas?
Edit: Relevant field XML
<Field ID="{5115854A-BC9E-498B-B54E-2EAAD6E89119}"
Type="Lookup"
Name="ParentCode"
DisplayName="BL2"
List="Lists/BL1"
FieldRef="Code"
ShowField="Title"
Group="BL Columns">
</Field>
Which references these fields in list BL1:
<Field ID="{DAAEF78C-4756-458E-8F8F-B40352BF5BEA}"
Type="Text"
Name="Title"
DisplayName="BL1"
Group="BL Columns">
</Field>
<Field ID="{42C00D43-D33F-420A-A85A-15E5AD0183F8}"
Type="Text"
Name="Code"
MaxLength="6"
DisplayName="BL1 Code"
Group="BL Columns">
</Field>
The contents of the lists are shown fine in the form dropdown, it's just the save that's broken.