{"id":998,"date":"2010-06-14T13:29:21","date_gmt":"2010-06-14T18:29:21","guid":{"rendered":"http:\/\/blogs.devhorizon.com\/reza\/?p=998"},"modified":"2010-06-14T13:50:03","modified_gmt":"2010-06-14T18:50:03","slug":"sharepoint-2010-creating-custom-list-definitions-that-use-infopath-forms","status":"publish","type":"post","link":"https:\/\/blogs.devhorizon.com\/reza\/2010\/06\/14\/sharepoint-2010-creating-custom-list-definitions-that-use-infopath-forms\/","title":{"rendered":"SharePoint 2010: Creating Custom List Definitions that Use InfoPath Forms"},"content":{"rendered":"<p>The general requirement is a &#8220;round-trip&#8221; of the form you want to add or replace. Before adding or replacing forms in a WSP, they need to be published. Once the form is in a WSP, it can be imported into any Visual Studio project (i.e. a project that defines a custom List definition) and reused. When you publish the form, URLs in the XSF file can be relativized, and other content can be added\/removed from XSN components as required by the publish process. We&#8217;re proposing the following, for example, when replacing a WSP form:<\/p>\n<p>1. Open the WSP in Visual Studio<br \/>\n2. Locate the XSN in the WSP (there is a standard structure for both list and form library forms).<br \/>\n3. Download a copy of the XSN from SharePoint server using SPD, or make a copy of the XSN that is currently in the WSP.<br \/>\n4. Make the required modifications to the XSN in the InfoPath Designer application<br \/>\n5. Publish the form back to SharePoint<br \/>\n6. Download the XSN from SharePoint using SPD.<br \/>\n7. Replace the XSN in the WSP<br \/>\n8. Repackage\/deploy the WSP<\/p>\n<p>That&#8217;s the general &#8220;life-cycle&#8221; and practice. The process below is touching on deploying a SharePoint list form:<\/p>\n<p>If you&#8217;ve already upsized a list, before importing the Site WSP into Visual Studio, the XSN will exist in the WSP and can be modified. There is also a process for adding a form to a list definition in a WSP which involves several manual steps. At a high level, the latter involves:<\/p>\n<p>1. Add the XmlDocument to the Schema.xml (under List instances)<br \/>\n2. Under the Modules node, add a new Module (Item_):<\/p>\n<ul>\n<li> Name: Lists&lt;name&gt;Item_<\/li>\n<li>Modify the Elements.xml file.<\/li>\n<li>Remove the &#8220;Sample.txt&#8221; file added by VS.<\/li>\n<li>Add Folders under the created module and add the XSN template so that the path matches the one described in the Elements.xml file<\/li>\n<\/ul>\n<p>3. Add the Item_pages Module:<\/p>\n<ul>\n<li> Name: Lists&lt;name&gt;Item_pages<\/li>\n<li>Get the List ID (On the SharePoint server, the link to Add a new list item contains the List ID, it can be copied from there.) &lt;- this step might not be necessary, the deployment process\u00a0 doesn&#8217;t match the list by ID but by name, any GUID would do as long as it&#8217;s unique.<\/li>\n<li>Ensure the sharePointListID attribute (under the sharepointListAdapterRW node) on the manifest.xsf file matches the GUID &#8220;id&#8221; value for the Elements.xml file created in this step.<\/li>\n<li>Add the property bag to the _pages node.<\/li>\n<li>Requires: vti_eTag: maps to the uniqueID for the folder &#8220;Lists\\&lt;name&gt;\\item&#8221;.\u00a0 &#8211;&gt; More specifically: PropertyBag refers to the properties of the &#8220;item&#8221; folder.<\/li>\n<\/ul>\n<p>4. Add a property bag per item to the modules, one for each:<\/p>\n<ul>\n<li> Template.xsn<\/li>\n<li>Displayifs.aspx<\/li>\n<li>EditIfs.aspx<\/li>\n<li>NewIfs.aspx<\/li>\n<\/ul>\n<p>On the &#8220;Features&#8221; node add the Modules created before (step 2 &amp; 3: Lists&lt;name&gt;Item_\u00a0\u00a0 &amp; Lists&lt;name&gt;Item_pages)<\/p>\n<p>That&#8217;s it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The general requirement is a &#8220;round-trip&#8221; of the form you want to add or replace. Before adding or replacing forms in a WSP, they need to be published. Once the form is in a WSP, it can be imported into any Visual Studio project (i.e. a project that defines a custom List definition) and reused. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-998","post","type-post","status-publish","format-standard","hentry","category-sharepoint-2010"],"_links":{"self":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/comments?post=998"}],"version-history":[{"count":0,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/998\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/media?parent=998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/categories?post=998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/tags?post=998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}