.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to associate Custom Form with External List?

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :SharePoint


I've been trying for several days now to figure out how to programmatically associate a custom form with an external list.  Currently I'm creating an external content type + external list programmatically (in Visual Studio) when my feature activates.  I now want to define some custom forms for viewing/editing the list items in my external list.  I cannot figure out the right approach to make this work.  I can create and associate the custom forms with the external list in SharePoint Designer, so I know its possible, I just can't figure out how to do this in Visual Studio.

In Visual Studio I can provision an aspx file and have it deployed to my list's folder, but when I try to set that aspx file as the list's default display form it tells me the page is not a valid form.  For example...

myList.DefaultDisplayFormUrl = "Lists/LocationsList/MyDisForm.aspx";

...will fail even though that page exists at that url.  It think it fails because the list does not contain an item in its Forms collection with that url.  All my attempts to modify the list's Forms collection have failed.  It appears to be read-only.

Anyone have any ideas?



View Complete Post

More Related Resource Links

SharePoint 2007 - How to associate a Custom List View with a Custom Edit Form. Edit link always re


Can someone give me a clue of how to connect a specific Custom List View with a custom Edit Form.

I have created a custom list, and I have created a custom view attached to that list.   I also have a custom CustomEditForm.aspx form created using SharePoint Designer.

I want to associate the Custom Edit form directly with one and one view only for a given list so that when the user clicks the edit icon in that view, they are linked to the custom Edit Form.  But all other views including the All Items view behave as normal, i.e. using the normal EditForm.aspx.

I can replace the EditForm.aspx in the Url with my custom form and it works fine, but I can't seem to figure out how to connect the custom view edit link to the custom form.  It always takes me back to the default EditForm.aspx page.

I have investigated the href="{$URL_Edit}?ID={@ID}" onclick="GoToPage('{$URL_Edit}?ID={@ID}') in code, which appears to  be how the URL is generated but I'm not sure how or where best to set the value of URL_Edit parameter so that I point to the custom Edit Form.  This is somehow getting passed into the custom view, but I'm not sure how best to set it for a specific non-AllItems view.

Does anyone

create new custom list form in sharepoint designer and edit in browser

hi, i have created a new list using sharepoint designer 2007. now i inserted a custom list form to modify some field and add new ones. when i finished i will tight my new custom list to the custom form. what i want to know is. i see the status field in my new form. and i only want the status field to appear in the edit form for the one that has the permission to edit the status. then i tought of open the list in my browser and go to the list settings. but what i notice is i dont see my fields i have modified in sharepiont designer in the columns section i only see the ones from the existing list. my question is how can i hide the status field in the new item form that it only show in the edit form. and how do i get my new form in the column section so the end user can add more fields if they want without using sharepointdesigner thnx

Connecting a Sharepoint Custom list with an external Data-source

Hi I am planning to connect a Sharepoint Custom list with an external Data-source. External DB will be in Access 2007 format. More Information: I need a solution that we can connect our sharepoint list (one-way) to online db in a way that new  information is directly updated in the sharepoint list, whilst other info changed in sharepoint list  is not synced back to original value. Is there a way to solve this? -saumil

Adding a custom form to List's FormCollection in code

Hello, In a site within a site collection, using SharePoint Designer 2010 we have created custom Display, Edit and View forms and assigned them to the Item content type of a custom list as it's default forms. When looking at the Forms property of the list, I can see all six forms listed: the three original forms (DispForm.aspx, EditForm.aspx, NewForm.aspx) and the three custom forms (displayifs.aspx, editifs.aspx, newifs.aspx). Each site in the site collection has this custom list and I want to add these three custom forms to the custom list in each site in the collection as the default forms for items. In code I have tried copying the files from the Item subfolder of the first custom list to the Item subfolder in each list in each site, and then setting the properties for the Item content type's default forms to point to these new files (e.g DisplayFormUrl = "~list/Item/displayifs.aspx"; EditFormUrl = "~list/Item/editifs.aspx"; NewFormUrl = "~list/Item/newifs.aspx";) and I have also copied the fourth file template.asxn to this folder in each list. However, I have not found how to add these new files to the Forms property of the list iteself, as this property is read-only. It still only contains the three default forms. Is this possible to do in code? When I try to open the Display form or Edit form in

how to add a datasource to a custom list form

hi, is this possible? if i create a new item form in SPD 2007 using custom list form, is it possible to add my own datasource to this new item form and use my own tables?

Invalid URL error on InfoPath Form Publish on an External List

I am using SP2010 Enterprise on Windows 7 and SPD 2010 & InfoPath 2010 all on the same machine in test.  I create an External List based on a ECT and Click on the 'Design Forms in InfoPath' icon and 'Item' which drops down from it.  That launches InfoPath Designer 2010 & downloads the form from http://<site>/lists/<mylistname>/Item/template.xsn and sets you up in an edit session.  I can make changes on the form but when I publish via File | Publish | External List (Publish Form To An External List) I get a save prompt for local copy & then an error: The following URL is not valid: http://<site>/lists/<mylistname>/Item/template.xsn  (same URL as it started with during the initial download). I took screen shots of the messages to make sure. Some things I have tried & observations: If I change to an internal Custom List the publish step (to list not external of course) works just fine. I also ran this test launching SPD as Administrator with no difference.  I stopped the System Event Notification service per http://serena-yeoh.blogspot.com/2006/08/infopathformurlnotvalid.html  'net stop sens' with no difference Any ideas are welcome. BTW I notice that this step of launching the InfoPath designer does change the form on the list in Sharepoint albeit slightly -

Inserting a custom list form for a custom content type

Hello, When I try to insert a custom list form for a custom content type I created, nothing happens. Same thing is for the content type "message" & "discussion". I already cleaned up my profile (http://blogs.msdn.com/b/spdsupport/archive/2008/07/03/how-to-fix-custom-list-forms-will-not-insert-or-show-up-on-the-design-surface-of-sharepoint-designer.aspx) I use MOSS 2007 version and SP designer 2007 SP2 on Win7. Below you can see an example of the custom content type.     Columns Name Type Status Source Title Single line of text Required Item Segment Lookup Optional   Form Lookup Optional   Main Product Lookup Optional   Weight Number Optional   Price/Kg Currency Optional   Unit Price Currency Optional   Manufacturer Lookup Optional   Packaging Lookup Optional   PL Yes/No Optional   Label Lookup Optional   USP Lookup Optional   POSC Lookup Required   Place Lookup Hidden StoreCheckHeader Country Lookup Hidden StoreCheckHeader SC_Link Single line of text Hidden StoreCheckHeader

Validation is not working in Custom List Form using JavaScript ddwrt:GenFireServerEvent()

Hii am creating custom New form for a list using sharepoint designer. i have added the below button for sumbit<input name="Submit1" type="submit" value="Submit" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={http://myserver/Lists/VTest/AllItems.aspx}')}" />                <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;                                    </xsl:text><input name="Submit2" type="submit" value="Cancel" onclick="javascript: {ddwrt:GenFireServerEvent('__redirect={http://myserver/Lists/VTest/AllItems.aspx}')}" />the problem is the validation is not working properly. it submits the page without entering values for the required fields.particularly the validation is not working for DateFields.let me know what is the problem here. is it a Bug?muthu

Add a New Item to a Custom Sharepoint List and Sharepoint Calendar from one Infopath form.


I am trying to create an infopath form for requesting time off.  Once the request is approved I want the form to add the event to a calendar on sharepoint.  I was able to do this using the article by S.Y.M. Wong-A-Ton at http://www.bizsupportonline.net/infopath2007/programmatically-add-item-sharepoint-calendar-infopath.htm.  But I want the form to also add an item to a custom list that has the employees available time off stored on it.  That way the form can automatically subtract the time entered on the infopath form from what is available on the custom list.  I was able to do this using another article by S.Y.M. Wong-A-Ton at  http://www.bizsupportonline.net/infopath2007/programmatically-add-rich-text-item-sharepoint-list-infopath.htm.  I can make both of these functions happen seperately but I need them to happen on the same Infopath form.  I am using Infopath and MOSS 2007.  I have tried to use 2 CAML receive data files and I treid to co

BCS Method Security / External Content Type Permissions / Custom List Security Provider / Security T


I have an external list setup with the usual CRUD methods.  The external SQL table is also being populated by another source.  I want to enable/disable deleting depending on whether the record was created from SharePoint.  I would also like the normal list permissions to work.  So if a user has permissions to delete on the list, they can only delete items created for SharePoint. 

Where should this logic be incorporated?  On the BCS Delete method, somewhere in the External Content Type or on the list instance?  Most examples I find relate to security trimming for search.  I'm only concerned about the delete method.

I'm sure there are multiple ways to accomplish this.  Which is the best?


Custom Action for specific External Content Type List


I have an External Content Type list instance feature in Visual Studio. Deploying the instance works fine. However, I can't create a custom action using RegistrationId="{$ListId:Lists/yourlistname;}" RegistrationType="List"

Even if I specify the list Id as follows RegistrationId="{8F595340-5D08-4287-8BF6-30D50989D2F4}" or RegistrationId="8F595340-5D08-4287-8BF6-30D50989D2F4" I get nothing.

However, RegistrationId="600" works fine, but for all External Content Type lists.

I added the custom action with SharePoint Designer and it works as expected. When I generate a site template and import it into Visual Studio, the custom action uses RegistrationId="{$ListId:Lists/yourlistname;}" RegistrationType="List"

Creating a new site based on the site template creates the custom action correctly. However, deploying just the custom action does not work (feature deploys, but no custom action appears). I also tried RegistrationId="0x0100D67E541CC4BB6A4A9D62D22657ECFF68" RegistrationType="ContentType" with no luck. The content type id was pulled from the list instance using the object model.

I have to tie the custom action to a specific list instance. Because the li

Edit form List for External content type



I've made a list based on an extenal content type and create an InfoPath form just for viewing details on list items (read only)

My problem is that  the page(displayifs.aspx) displaying this form doesn't have a title (it's blank) and I don't know how to change it.



Sorin Sandu

External List Infopath Form - people picker and dropdown


I am editing external list form in InfoPath. I have two questions

1)      My requirements are to put people picker for say employee name field.

When I try to add this control it ask me to bound it to some field as there is no people field I can’t add this control. How can I achieve this?


Deploy Infopath form for Custom list


I used customise form option in custom list ribbon menu, and customised the form in Infopath. I used publish option from Infopath its sucessfully reflected in SharePoint site. I have new data connections as well.

Now I ve to deploy the same in Production machine, I have to give script or wsp to the admin guy. Any pointers.

How to add a Repeating Table to Sharepoint Custom List (via Customize Form)



I have create a InfoPath Form Library, and I have a repeating table on the InfoPath form. Now I want to submit the same Templete to a SharePoint List(with the repeating table), is it possible?  



can not attach custom aspx list item form to the list




I'm need make custom aspx list item form for tasks of my workflow. I'm use code from this book: SharePoint 2010 as a Development Platform


my Elements.xml file

<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <ContentType ID="0x010801005c12bbf6e6e548569e8100f1ad953859"

               Name="?????? ???????? ???????? ?????????? ???????????"

               Group="Custom Content Types"

               Description="My Content Type"



Custom Form NewForm.aspx for List


hi All

I have ContentType with one field and its custom New , Edit and display.

I attached this content type to custom list.

As I try to add new item to List, Custom NewForm.aspx from layouts pages is opened, that is gr8 as per requirement.

but i am using sharepoint control dropdownchoice for one field in contenttype with serveral properties set.

and as I try to submit the data I am getting error like


Failed to get value of the "CustomField" column from the "Choice" field type control.  See details in log. Exception message: Object reference not set to an instance of an object..


I am not able to track it out....


Any Suggestion


Saumil Thakkar



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend