Custom List Form creation using Powershell - SharePoint 2013

Hi,
I have a custom List called 'IssuesList' with 4 fields - "IssueTitle","IssueID","IssueDesc","Status"
While displaying display form I should show 3 fields expect Issue ID i.e. IssueID should be hidden.
and on edit form only Status field should be editable. So using SharePoint designer I created respective Edit form and display forms and changed XSLT to control the display mode on the fields.
I have everything scripted in powershell till now - creation of custom list, publishing pages, webparts etc. however I am looking for how to provision or associate these 2 list forms with IssuesList after I create the list in new site.
I have restrictions on using wsp and site/list template due to business needs. So I need to know if there is any way I can upload these 2 files after I create custom list in powershell and associate them as defaultdisplay and defauteditforms?
Please advise.

Hi,
Per my understanding, you might need to apply these custom forms to a list after list creation using PowerShell.
With PowerShell with SharePoint Object Model, we can hide fields on list forms.
The similar thread below with code snippet will provide more information about this:
https://social.technet.microsoft.com/Forums/en-US/ee6fc2eb-197f-4144-94fa-8a4e438675d9/hide-a-field-from-edit-form-list?forum=sharepointgeneralprevious
If there may be other requirements except for hiding fields, as you have limitation on using custom solution package(which should be preferable in such scenario),
a workaround I can provide is that, after list creation, you can add Content Editor Web Part contains the CSS style or JavaScript to the form pages of a specific list, it will help you hide/disable the specific elements, this can be achieved programmatically.
The code below can add a Content Editor Web Part to the DisplayForm of a list(though in C#):
public static void AddCEWP()
SPLimitedWebPartManager manager = null;
SPFile file = null;
using (SPSite site = new SPSite("http://sp"))
using (SPWeb web = site.RootWeb)
try
web.AllowUnsafeUpdates = true;
file = web.GetFile(web.Url + "/Lists/List018/DispForm.aspx");
manager = file.GetLimitedWebPartManager(PersonalizationScope.Shared);
ContentEditorWebPart webPart = new ContentEditorWebPart();
XmlDocument xmlDoc = new XmlDocument();
XmlElement xmlElement = xmlDoc.CreateElement("HtmlContent");
//xmlElement.InnerText = "<strong>Hello World!</strong>";
//write the custom CSS style or JavaScript here
string content = "<style>your custom style here...</style>";
xmlElement.InnerText = content;
webPart.Content = xmlElement;
manager.AddWebPart(webPart, "Top", 0);
manager.SaveChanges(webPart);
web.Update();
catch (Exception ex)
//Utility.SPTraceLogError(ex);
finally
if (manager != null)
manager.Dispose();
web.AllowUnsafeUpdates = false;
About how to hide fields on Standard List Forms using jQuery:
http://social.technet.microsoft.com/wiki/contents/articles/21730.sharepoint-2010-conditionally-hide-fields-on-standard-list-forms-using-jquery.aspx
http://stackoverflow.com/questions/10010405/how-to-hide-a-field-in-sharepoint-display-form-based-on-the-field-name-jquery
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
contact [email protected]
Patrick Liang
TechNet Community Support

Similar Messages

  • Cannot delete Document Content Type. Getting error "Document Content Type Still in use" powershell, sharepoint 2013

    not able to delete "Document" content type from a library. I have a custom content type. I have added the custom content type to all the items of library. also, i have added the custom columns from "Document" content type to my custom
    content type. Still cannot delete the "Document" content type. I am doing the same process in different site collections and different libraries. But not able to delete in a few say- 10 in 100. Get the error - "Document content type is still
    in use"

    Hello 
    Here you go
    http://blog.octavie.nl/index.php/2012/09/14/error-the-content-type-is-in-use-explained
    https://social.technet.microsoft.com/Forums/en-US/e81020e3-2c12-4f39-a2f4-f1fd88ba6547/content-type-is-still-in-use-on-document-library
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How to have digital signature in a Sharepoint 2013 custom list form created in InfoPath 2013?

    I have a requirement that they want a form in SP13 that would allow Mobile mode.  Supervisor then can sign off the form in mobile mode.  Because Document Library form doesn't have Mobile client support so I decided to create this as a custom List
    form.  Now I'm finding out that when I right click on the section on the form to enable e-signature, there is no such option.   I appreciate it if someone can give me some suggestion on how to have a form that has both Mobile mode and e-signature
    support in SP13.
    I also noticed that the people picker doesn't work in Mobile mode.  Is that so or is there something-else I need to configure?
    Thank you.

    Hi,
    According to your description, my understanding is that you want to create an InfoPath form which supports Mobile mode and e-signature in SharePoint 2013.
    Per my knowledge, the browser-based forms cannot support signature in Mobile device.
    Here are some other products which are not free can achieve this goal for you to take a look:
    http://forums.qdabra.com/2013/06/signing-infopath-forms-part-1-electronic-signatures/
    http://www.formotus.com/16563/infopath-alternatives/infopath-forms-filling-weigh-the-options
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • How to add .js link in custom list form through sharepoint designer 2013

    hi friends
    so far i was adding jquery code to script editor webpart in custom list form.
    but i need to know how to add .js link in custom list form through sharepoint designer 2013
    please help me.

    Hi,
    We can add the "JS Link Property" in the “WebPart” node in the custom list form page through SharePoint designer 2013.
    Here is an example for your reference:
    <JSLink xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">~site/Style Library/js/custom.js</JSLink>
    Noticed that, we should not lose the 'xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm' attribute.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Create Custom list form and validate fields using sharepoint designer 2010

    Hi All,
    I have a requirement to create a custom job application form which will be filled and submitted by anonymous users. I have a an option to create custom user control web part but I wanted to
    create it using custom list form using SharePoint designer. My requirement is below
    Date of birth (user age should be above 22yrs )
    Email Validation
    Phone validation
    Resume attachment (should attach only word documents or PDF)
    Qualification (If other is selected then show textbox else hide)
    Can above validations be done using SharePoint designer (JavaScript or validation controls)? Or do I have to create custom control web part?
    MercuryMan

    Hello,
    I think jquery/javascript can be used to put validations on those fields. Fortunately some of validation can be done via sharepoint itself like: email, phone, age. For Attachment and Qualification fields use jquery/JS.
    See below link for column validations:
    http://thechriskent.com/2012/08/15/validate-phone-number-columns-in-sharepoint/
    http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/
    See this for attachment:
    http://stackoverflow.com/questions/4234589/validation-of-file-extension-before-uploading-file
    For qualification:
    http://sharepoint.stackexchange.com/questions/88064/hide-show-field-on-list-form-based-on-value-from-another-field
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • User message entered in Validation settings does not show up in custom list form created in sharepoint designer 2010

    I have a custom list form created in SPD based on EditItem form.  I then set field validation in Validation setting and entered a user message to display when the validation did not pass.
    The validation works in the custom form but the user message never show up.
    I see a similar question posted in 2012:  
    https://social.technet.microsoft.com/Forums/en-US/cd292b50-856f-4dfa-8cfe-aeb688ee7185/validating-fields-on-a-sharepoint-2010-custom-list-form?forum=sharepointgeneralprevious 
    Is this still a known bug?   What is the easiest workaround?

    Hi ,
    From the
    above link you mentioned, have you tried using the code line in your custom form?
    Please try the code suggested by sp-achiever and hamish, and see if it could help solve the issue.
    <SharePoint:ItemValidationFailedMessage ControlMode="New" runat="server" ID="checkform" />
    Have you installed hotfix KB245789 or CU contained this kb?
    Please check if KB245789 has fixed this issue as KP2011 suggested in the same post, and please try it in a test environment firstly.
    http://support.microsoft.com/kb/2405789
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you havefeedback for TechNet Subscriber Support, contact [email protected] 
    Daniel Yang
    TechNet Community Support

  • Created By and Created Date fields not showing up on Custom List form webpart

    Hi,
    I have added Custom Listform WebPart on "DispForm.aspx" of custom list. I need to display, out of box fields "Author" [Created By] and "Created" [Creation Date] on this custom list form webpart, I have added them on the webpart, following is the code behind of aspx page:
    <td width ="400px" valign= "top" class="ms-formbody">
    <xsl: value-of select = "@Author" disable-output-escaping = "yes"/>
    </td>
    However these fields are not showing/populating data on the form ?? Any inputs ???
    Regards

    Hi,
    I think that when you insert a custom list form web part you select “Item” content type, so custom list form is designed to display only the fields that are appropriate for that content type “Item”, but the item content type doesn’t contain the created and created by column, when you add the two columns, it will not find the field value. By default, the two columns will display at the foot of the list form using SharePoint:CreatedModifiedInfo.
    Hope it can help you.
    Xue-Mei Chang

  • List forms corrupted after upgrade to 2013

    We upgraded from SharePoint 2010 to 2013. Most list forms, the ones from out of the box lists were corrupted so when we click on Add New Item or View Item we get an error. Sometimes it says list does not exist, sometimes it says "web parts page error"
    and so on. Also all customized list forms got corrupted as well.
    I need to know if there is a fix for that because when we tried to revert to the original default we did not find those forms in the report. We tried to revert the list views to the default but that also didn't work.
    Any advice is much appreciated.

    Try this...
    Do you have SharePoint Designer 2013 installed on client machines? if so, open target list delete non-working forms  and use good ones from another list.
    Steps in brief..
    In SPD at site level > Access List and Libraries > Select Problem list > delete existing 'NewForm.aspx'
    In SPD at site level > Access List and Libraries > Select Problem list > Add
    Form> Select Action 'New Items' > Set this form as Default> 'Type a new
    name 'NewForms''.aspx> Apply changes.

  • SP Designer 2010 - Saving custom list form impacts other list and other custom list form

    Hi,
    I have a source list, with custom display, edit and new forms all of them created in SP Designer 2010. These do nothing fancy, just for presentation purposes, fields were re-arranged in 2 columns.
    Then I created a target list by saving the source list as template, the template brought over all customizations, all seemed to work fine. So I started to modify the target custom list forms.
    Now here's the problem:
    After a while making changes to the target list I realized that somehow the custom list forms on the source list had been modified... so I opened the source list in designer and noticed that the out of the box forms: NewForm.aspx, DispForm.aspx, EditForm.aspx
    were now the default forms for the source list, and I couldn't pick my custom list forms to be the default forms for the source list anymore, they were not on the listbox. I could still see them by going in designer to All Files > Lists > SourceList
    > and if I previewed them, they were empty. 
    I believe that somehow source and target list are linked, but why would designer allow making changes to the source list? like resetting the default forms, and breaking up the custom list forms that were in place?
    I've verified list id's in the custom list forms of the target list and they belong to the GUID of the target list. I don't see anything else that could potentially point to the source list.
    SharePoint Designer 2010 version: 14.0.7007.1000 SP2 14.0.7015.1000 I don't think this matters much because I've tried with other SP Designer 2010 versions and the error is the same.
    thanks for your reply!

    Hi alec,
    When I create a custom EditForm1.aspx and set as default for a source list, then save this list as a template, then the newly created the target list based off this saved template, the source list still uses the custom EditForm1.aspx form as default
    form, from SharePoint designer, I can see these two lists have different listID, so they have no connection when I edit any one of them.
    Please recreate a new list with custom form page and save as template, then create a new list see if this issue could be reproduced, or we can create a new list instead if it is an isolate issue.
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Daniel Yang
    TechNet Community Support

  • SharePoint Custom New Form with DataForm Webpart SharePoint 2010

    Hi Guys,
    i have a Problem with my Custom NewForm.ASPX.  I Created a CustomForm like this Guide:
    http://www.ilikesharepoint.de/2013/11/sharepoint-create-custom-list-forms-with-visual-studio-part-2/
    Problem
    Now i set the DataFormWebpart for the Webpartzone on visible=False and add my custom DataformWebpart in this NewForm.aspx (see Code).
    After my deployment and click on "New item" i can see my custom DataForm Webpart.
    The Problems are:
    1. The Ribbon is Greyed out
    This post was not my solution. The Ribbons is not greyed out but the Ribbon has no function ("save Button" is broken)
    2. The Fields are not loaded and looks like a Displayform
    I Don't know why the Dataform does not load these fields. I can see the title but not the text Columns or lookups
    3. Save Button and the Ribbon does not work
    Only the Cancel button work on this Newform.aspx
    The Save button has no function

    Here my NewForm.aspx Link
    NewForm

  • Not able to Enable the Custom Ribbon button On Pages in Sharepoint 2013

    Hi Team,
    Not able to Enable the Custom Ribbon button On Pages in SharePoint 2013. we have used the button edit properties section of the Pages.
    Same is working for Lists but not for Pages.
    Thanks,
    Shrikant

    Thanks for your reply.
    Right now my server is not working to get the code. will share you in some time.
    I am just thinking if page get checked out and my control is also present in the Edit properties section then do I need to specify something explicitly to enable the button. The same is working for Lists.

  • Creating custom lists that are links to SharePoint sites.

    I am new to SharePoint 2013 Online and was wondering if there is a non-coding way to build a sub-site from a template that is not initially connected to a site collection. Attach this sub-site to a site an already existing site collection afterwards and
    use data from the sub-site that is created, to generate a custom list items that can also be used as links to the sub-site itself.
    How I thought this might work would be to create templates for site collections (if that is even possible), and then use a links list or some other type of linked list but not exactly sure how this is done in SharePoint.
    Any input on how to go about this would be greatly appreciated as well as any insight as to whether this is even possible to do with out coding. Thanks in advance.

    Hi,
    According to your post, my understanding is that you wanted to create custom lists that are links to SharePoint sub-sites.
    I recommend to create a custom list and add a multiple line column to display the sub-sites url.
    Then create a workflow associate a custom list and use “Call HTTP Web Service" action and “Build Dictionary" action to get the count of the sub-sites.
    Then use the Loop Stage to create a new item in the custom list and set the multiple line column to the url you get in the dictionary.
    Here is a great blog for you to take a look at:
    http://sergeluca.wordpress.com/2013/04/09/calling-the-sharepoint-2013-rest-api-from-a-sharepoint-designer-workflow/
    In addition, you can use the build-in webservice via SharePoint Designer.
    More information:
    http://www.balestra.be/2012/03/show-all-subsites-on-a-sharepoint-2010-page-without-code-via-sharepoint-designer.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Custom List Form - newform.aspx with code behind - beginner

    Hi,
    I am working on a request whereby I have to customize the NewForm.aspx. The form will have roughly about 30 controls. One of the controls on the form will pull data from a web service. Another will pull data from a sharepoint list, this is quite complex
    as there will be some logic involved. The form data will then be input as the items into the Main SharePoint list.
    I do know that there will be some code behind on the custom NewForm.aspx, and that it has to be done on Visual Studio.
    I am confused between the application page, custom form web part, or is there any others missing out. Which one of this the best practice, also can someone point out some msdn articles. I found some on the Net, but I find the guides too complicated and am
    finding it difficult to understand. 
    Please help

    It depends on how your users will interact with the list, are they going to use list newform.aspx to submit the data or will you be providing separate interface to submit the data. You can always go with custom webpart to incorporate all your business logic
    along with the interface required for end users.
    building custom webparts in SharePoint 2010
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/02/15/intro-to-sharepoint-2010-development-how-to-build-and-deploy-a-web-part.aspx
    Custom List form
    http://blog.karstein-consulting.com/2010/12/29/walkthrough-create-custom-sharepoint-2010-list-form-for-deployment-in-a-visual-studio-2010-project/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Forms based authentication in sharepoint 2013 using custom membership provider

    I am developing  FBA  for SP2013 using custom membership provider using the following link 
    http://benredl.wordpress.com/2012/10/03/creating-forms-based-authentication-and-user-profiles-in-sharepoint-2013-using-custom-membership-and-role-providers-and-a-custom-user-profile-synchronization-utility/
    the feature i am trying to develop is that the user is created using a homegrown asp.net  application which uses sql server 
    and then When that user goes to SP2013 he should be able to login with the username and password created using the homegrown asp.net application 
    my questions are following 
    If I follow the article in the link should i be taking the assembly(dll) and deploying it to GAC or will VS2013 automatically do it
    Do I have to implement  FindUserByEmail and FindUserByName methods ?
    if the connectionstring for an asp.net application is in the web.config file  where would the connection for the sqlserver go if this application is for SharePoint 
    TIA

    Hi TIA,
    try this it contains the code for you and it is ready
    http://sharepoint2013fba.codeplex.com/
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • Open Edit form directly when list item is clicked in Sharepoint 2013 list

    Hi,
    I have a list web part, wherein the user clicks the item it should open in the Edit form directly. various forum i checked was for SharePoint 2010, as we do not have design mode in SharePoint designer 2013, I am unable to do.. I know
    if I the change the form type from default page to edit page, it will work, but not sure about how to go ahead. Could anyone help me to achieve this please....

    Sunitha,
    You can do this with some jQuery and JavaScript.  Look at this post:
    http://brandonatkinson.blogspot.com/2013/11/open-sharepoint-2013-list-items.html
    Basically, add a Script Editor Web Part to the page and include this snippet:
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script type="text/javascript">
    $(function() {
    // Change all display form links to edit form links
    $('.ms-vb a[href*="listform.aspx"]').each(function(){
    var link = $(this).attr('href');
    link = link.replace("PageType=4", "PageType=6");
    $(this).attr('href', link);
    </script>
    Brandon Atkinson
    Blog: http://brandonatkinson.blogspot.com

Maybe you are looking for

  • IS AUTO - How to block creation of delivery

    Hi, We are working on IS Auto Industry. Right now we are facing one issue. We are getting confirmation of service instead of GI. I do analysed the problem and found that this is happening because of the following. We are creating delivery using BF Me

  • Window 8 upgrade has really messed up my PC.

    As a result of a Window 8 upgrade on 5th Dec and caused major problems for my PC I now have the following Failure ID on my PC. Failure ID: UAG7MX-6JW7AN-MFPXOK-61D303, Product ID: C4M14EA#ABU, Hard Disk 1. Can anybody explain the problem and how to r

  • Premiere Elements shows white screen

    At some point in generating a project, the SW suddenly shows a "white screen". Then the Windows 7 Screen gives you the option to wait for the program or exit. After 30 to 50sec. the screen is normal again, but then starts showing white again. When st

  • KOC4 Vs KE5Z

    Dear experts     I am trying to see the link between KOC4 and KE5Z report. Is there any link between these two reports ?

  • Do i need to get internet service with an internet provider?

    Do i need to get internet service with an internet provider to use airport extreme or airport express?