Question

I want to hide some fields in my Display Form... I was using jQuery:

$(document).ready(function(){
   $("A[name = 'SPBookmark_Start_x0020_date']").closest("tr").hide();
});

But when the page loads, the fields are there.... so the fields are only hidden after javascript executes the code... this is a problem to me... some users CANT see this values...
Is there a way to not load some fields in Display Form?

Was it helpful?

Solution

It is simple like this.

SPUtility.GetSPField('City').Hide();

Please refer this question to show how to apply it.

Edit:

As far as you are concerned not only on the displaying and having high security concerns over the security of data, you better try something like creating another list with a one-to-one mapping. Then add a lookup column from first list to the second list and move the secured column from first list to second list. Then you can give a restricted permission on the second list. This will be the option as you cannot use SPD or even InfoPath.

OTHER TIPS

The answer has already been given.

Either use Powershell to hide the field in Display Form (take a look at another discussion for some helpful guidance or at this page)

#Get the web and site column objects
$web = Get-SPWeb http://site
$column = $web.Fields["Column To hide"]

#Set the PushChangesToLists property for the changes to be applied
#to lists where the column has already been added
$column.PushChangesToLists = $true

#Change the ShowInEditForm and other properties and update objects
$column.ShowInEditForm = $false
$column.ShowInNewForm = $false
$column.ShowInDisplayForm = $true
£column.ShowInViewForms = $true
$column.Update()
$web.Update()
$web.Dispose()

Or Use Sharepoint Manager which is an essential tool for Sharepoint anyway and since it has a Graphical User Interface it is great for beginners too.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top