How do I retrieve a column that is hidden (List content type >> Change content type column >> hidden) in the AfterProperties when using event receivers?

properties.AfterProperties["columnName"] = "new value"; //returning null because columnName is hidden

I noticed that when the events are triggered from document library, the hidden column can still be retrieved and updated but it returned null when triggered from custom list.

  • For which event you are accessing column?? for example, ItemAdding, ItemAdded, etc... – SID Aug 27 '16 at 11:21
  • ItemUpdating and ItemAdding. – user59385 Aug 29 '16 at 1:26
  • AfterProperties have values only if you really change the value for that fields. If you don't, you'll obtain a collection of 0 items. As per your question description "ColumnName" is hidden and you will never update it's value from New or Edit form. Therefore it will be always null. – SID Aug 29 '16 at 5:03
  • Thanks, then I guess I need to find another way to update the value. – user59385 Aug 29 '16 at 7:24
  • But strangely, it seems that I can retrieve and update hidden columns' values if they are from document library. – user59385 Aug 29 '16 at 7:31

Your Answer

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

Browse other questions tagged or ask your own question.