1

I am using a custom form CustomForm.aspx in place of NewForm.aspx for a list,

From content type of list I have set the field(column) as Hidden but using JSOM get_hidden() returns false

What can I do to get the actual status of field if it is hidden or not.

2

You could try and check the field on the content type instead:

(function(ctx) {
    var field = ctx.get_web().getList(_spPageContextInfo.webAbsoluteUrl + "/Lists/Tasks").get_fields().getByInternalNameOrTitle("StartDate");
    var ctField = ctx.get_web().getList(_spPageContextInfo.webAbsoluteUrl + "/Lists/Tasks").get_contentTypes().getById("0x010800F6B0BE8B7684574F82A6FCC51E1D8A37").get_fields().getByInternalNameOrTitle("StartDate");
    ctx.load(ctField, "Hidden")
    ctx.load(field, "Hidden");

    ctx.executeQueryAsync( function() { 
          console.log(ctField.get_hidden());
          console.log(field.get_hidden())
    }, function(s,a) { console.log(a.get_message()) })
})( SP.ClientContext.get_current() )
2
  • Thanks, it would slow down a bit, but I will try. – codemirror Aug 3 '17 at 11:57
  • 1
    @codemirror yeah, you probably have to set it to hidden with code. When you use hide with the GUI you are doing it on the CT i recon. field.set_hidden("true"); – Anders Aune Aug 4 '17 at 7:29

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.