Anyway, I want to get fields which are displayed in (random) list's New Form. I tried exposing fields with SPField.ShowInNewForm property, but without luck (as far as I can tell, if I don't explicitly write in list's schema this property, it will return false, even if view is using this field in New Form). My second approach was to get all views tied to particular list, but I couldn't know which one of them is actually used in New Form.
Any help or tip is more then welcome.
EDIT: At the moment script is checking if SPField is required, but it's not really the solution I'm looking for (I'd like to get all fields present in New Form).
EDIT 2: Script should work even if Edit Form and New Form have different views (e.g. Title of item is shown in New Form view but not in Edit Form view).
Ramesh PalaniappanPosted Aug 16, 2016, 8:18 AM
You can try the field property
CanBeDisplayedInEditForm. Loop through the list fields and check this property like below.There doesn't seem to have an easy one way solution to this problem. You may need to use combination of field properties like
CanBeDisplayedInEditForm,ShowInNewFormetc in theifcondition to fix this issue.