@mary.maria You might wanna try
I think nlapiSetDisplaytype is deprecated but the below method works fine.
var field = nlapiGetField ('cleared') ;
field.setDisplayType(type);
type can take following values: inline|normal|hidden|disabled|readonly|entry
Also, you might wanna know, that you can use this only on field that are scripted (created using script either using form object in UE or Suitlets).