If I set the title field to Read only (since I will calculate it based upon other values) in the ListAdded Event handler, when i open up a form for creating a new item i get an error.
Event handler..
public override void ListAdded(SPListEventProperties properties)
{
//Set Title column as READ ONLY
SPField f = properties.List.Fields[new Guid("{fa564e0f-0c70-4ab9-b863-0177e6ddd247}")];
f.ReadOnlyField = true;
f.Update();
base.ListAdded(properties);
}
This works, as the Title field no longer shows up in the new item form, but when debugging in get a JS error , and I think it is due to the form trying to focus that field. If instead i set INHERIT=FALSE on the content type, title dissappears fro mthe form, but so does another site column i aded ot the content type, Assigned To. Assigned To is still in the custom content type, but it does not show up on the new form when adding an item to the list.
Any ideas on how ot get the Assigned To field back in the form?
f.Required = false;
. I had manually created one task list withTitle
field to beReadOnly
. No errors everything is working as expected.