Question

I created a BDC list. When I create a new item, I have to type in all the neccessary columns.

I want to make two of the columns radiobutton choice and dropdown list.

I can't create new columns for these types. I think I have to modify the TypeDescriptors through .bdcm but I don't know how to.

Answer:

I modify my NewForm with SharepointDesigner after deploy the BDC.

I put this jquery into the PlaceHolderAdditionalPageHead.

    <script type="text/javascript">
    $(document).ready(function()
{
    $("input[title='KadroTipi']").attr("style","display:none;");//.parent().append('<select><option value="idari" selected="selected">İdari</option><option value="doktor">Doktor</option></select>');
     $('<select><option value="idari" selected="selected">İdari</option><option value="doktor">Doktor</option></select>').insertBefore("input[title='KadroTipi']")
}); 
    </script>
Was it helpful?

Solution

On SE here is something regarding the TypeDescriptor, but I do not think that this is the way for changing the BDC List Column Type. However, I don't know the way to edit it in this way, so I've upvoted your question.

There is a similar question on SE here. One of the proposed answers was a link to the SPCascadeDropdowns function in SPServices on codeplex. It gave me an idea to create a Javascript to show the items as a dropdown list. Following is a procedure for doing this with jQuery.

You should follow the procedure on your link to Tobias Zimmergren's blog with the topic Customizing the forms for External Lists (BCS) in SharePoint 2010 by using Custom Field Controls and jQuery. He suggests that it is not recommended to edit the BDC Model via Visual Studio, but via XML so here are the steps to edit it via SP Designer shown on Prachi Sarnot's blog:

  1. Select the External Content Types in left navigation pane in SharePoint Designer 2010.
  2. Select the ECT which you want to export and click Export BDC Model in the ribbon.
  3. In the Export BDC Model box, specify the BDC Model Name (eg. CustomerDetails) and click OK.
  4. Change the Save as type to All Files in the File Save dialog box.
  5. Choose a destination folder for the file and change the File Name box to "CustomerDetails.xml".
  6. Click Save.
  7. Edit the XML file like on Tobias' blog.
  8. Navigate to the Business Data Connectivity Service configuration in the Central Administration.
  9. Click Import in the BDC Models tab in the ribbon. Note: The same BDC Model should not already exist in the store.
  10. Click the Import button. You may see one or two warnings, but there should be no errors.
  11. Click OK.
  12. Proceed with the instructions on Tobias' blog on how to put the jQuery.

I really hope that this helps you. It is a shame however, that this cannot be done through SP itself. Maybe in some new version of SP this will be implemented. If someone else finds a better way on doing this, please post it :)

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