Skip to main content
Tweeted twitter.com/#!/StackSharePoint/status/388596217628073984
added 32 characters in body
Source Link
ozdogan
  • 997
  • 5
  • 23
  • 46

I have a field for a custom document library, that must only be updated from code (event receiver) not from UI. So i set this field ShowInNewForm=“FALSE” and ShowInEditForm=“FALSE”. But this time, in code i cannot access this field. item["MyField"]When trying to access the field inside code, it throws exception that says there is no field like this. But when i remove ShowInNewForm=“FALSE” property in content type, i can access the field and its value inside the code. Is there anybody who knows why does it work like this?

I have a field for a custom document library, that must only be updated from code (event receiver) not from UI. So i set this field ShowInNewForm=“FALSE” and ShowInEditForm=“FALSE”. But this time, in code i cannot access this field. item["MyField"] throws exception that says there is no field like this. But when i remove ShowInNewForm=“FALSE” property in content type, i can access the field and its value inside the code. Is there anybody who knows why does it work like this?

I have a field for a custom document library, that must only be updated from code (event receiver) not from UI. So i set this field ShowInNewForm=“FALSE” and ShowInEditForm=“FALSE”. But this time, in code i cannot access this field. When trying to access the field inside code, it throws exception that says there is no field like this. But when i remove ShowInNewForm=“FALSE” property in content type, i can access the field and its value inside the code. Is there anybody who knows why does it work like this?

Source Link
ozdogan
  • 997
  • 5
  • 23
  • 46

Field ShowInNewForm=“FALSE” Cannot Be Accessed In Code

I have a field for a custom document library, that must only be updated from code (event receiver) not from UI. So i set this field ShowInNewForm=“FALSE” and ShowInEditForm=“FALSE”. But this time, in code i cannot access this field. item["MyField"] throws exception that says there is no field like this. But when i remove ShowInNewForm=“FALSE” property in content type, i can access the field and its value inside the code. Is there anybody who knows why does it work like this?