"The day you stop learning SharePoint is the day you stop using it."

Hide a field from SharePoint Designer Form - NewForm/DisplayForm/EditForm

To hide a field from any of the SharePoint Designer Form we usually create a custom form and edit the code and add a style attribute as style="display:none" in <tr> element.

But what if you do not want to create a custom form and hide the field on the default form? Is it possible? The answer is YES.

You can hide the field on default SPD form via PowerShell command without having to create a custom form.

Open SharePoint Management Shell and type the following commands. The below example hides a field from a NewForm.

$web = Get-SPWeb webUrl
$list = $web.Lists.TryGetList("ListName")
if($list)
{
    $field = $list.Fields["FieldName"]
    $field.ShowInNewForm = $false
    $field.Update()
}
$web.Dispose()

You can similarly execute the below command for DisplayForm and EditForm. The only statement you need to change is:
$field.ShowInDisplayForm = $false
$field.ShowInEditForm = $false
Share:

Identify the type of SharePoint List Template

There are three methods that I know to identify the type of SharePoint List template. All the methods has easy steps to execute and find the type:

     1. Using Browser Method
·         Open that SharePoint List which you want to identify its type and ensure to open that list in AllItems.aspx view. Then in your web browser click on the menu bar > View > Source or simply right click on the page and select View Source and search for ctx.listTemplate.
·         Once you find ctx.listTemplate then match its value with the available List Template IDs (Click Here).

     2. Using PowerShell Command
·         Connect to your SharePoint Server and open SharePoint 2010 Management Shell.
·         Type the following commands that would retrieve all list and libraries in a web site. Search the name of your target list/library and match the Type_Client with List Template IDs given in above link.

>> $SPWeb = Get-SPWeb “http://yourSharePointServer/
>> $SPWeb.ListTemplates | Select Name, type, type_client, Description

Example:




     







3.
 
Using XML
·         Go to List/Library Settings and from the browser URL copy the string that appears after List=
·         Open this web site http://meyerweb.com/eric/tools/dencoder/ and paste the copied string and press Decode button.
·         Now copy the decoded string paste it somewhere in notepad.
·         Get the SharePoint web site URL under which the list/library is created.
·         Now construct the URL as below example:

·         In the above URL all remain same except the website URL before /_vti_bin/ and copy your decoded List ID and put it inside the braces { } after List=
·         Then finally copy the entire constructed URL and paste into IE and press Enter.
·        In the XML returned by browser search for text ServerTemplate and match its value with the List Template ID, link provided in point 1.
Share:

SharePoint-StackExchange Moderator

Author's Profile

My photo
India
A SharePoint Enthusiast working as a Lead Solution Architect for an IT Software & Consulting Company in Mumbai. I believe in giving back to the community through which I also learn and develop and eventually grow as an individual and professional. This blog is a small contribution to the community where I live in and may help someone who is seeking knowledge like me.

Popular Posts

Powered by Blogger.

Contact Form

Name

Email *

Message *

Total Pageviews