Dyanamic form generation based on list columns

Hello all ,
How can i create a Sharepoint webpart for List form which is dyanamically create controls based on Selected field in view ...
Suppose I am having one Sharepoint list ... In that there are 4 columns ...
A -- as text box , B - Dropdown , C - Choice , D- richtexbox
and View I have selected only field A,B,D
Now the in webpart form should be render only with selected control in List view..

Hi,
According to your description, you want to create controls dynamically based on the selected view fields.
You can get the view fields type using SPView.ViewFields Object. Then you can create the control based on the field type.
More information about SPView Object for your reference:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spview.viewfields.ASPX
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/0eb6bf19-e112-432f-87a9-719c8447c66c/get-all-columns-properties-of-the-particular-view-in-the-sharepoint-list?forum=sharepointdevelopmentprevious
More information about how to create form control dynamically:
http://zieglers.wordpress.com/2010/04/08/dynamically-creating-form-controls-in-sharepoint/
As another workaround, you can hide the control which is not in list view in New/Edit form using JavaScript:
http://www.sharepointdiary.com/2012/12/hide-columns-in-newform-editform-dispforms.html
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • Master Details form (LOV based on Detail Column of Join Condition)

    I have created a master detail form where user_id is joining master and details.
    I have created one dynamic lov based on child user_id in detail block to diplay all user who works under current user.
    Problem : When i want to select Insert detail action in detail block the dynamic lov should read the user_id which is going to be inserted when you press Save button. Means as its not getting populated till one click on save button my lov is not getting refereshed.
    Please advice what should i do.
    Thanks
    Bakulesh

    I solved myself by modifing some guru's script from this forum little bit. I am adding here for feedback or use to any.
    htp.p('<script language="JavaScript1.3">
    function getMstFieldValue(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "MASTER_BLOCK")
    return form.elements[i].value;
    function setDetFieldValue(form,fieldName,value)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements[i].name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "DETAIL_BLOCK")
    form.elements[i].value = value;
    </script>');
    thanks
    Bakulesh

  • WCF based External List Columns Type in Sharepoint 2010

    In my Sharepoint 2010 I've created External List that uses WCF service as data source. This is my data type that is exposed by the service:
    [DataContract]
    public class Item
    [DataMember]
    public Guid Id { get; set; }
    [DataMember]
    public string Name { get; set; }
    [DataMember]
    public string Description { get; set; }
    Everything is fine as long as I'm using simple types such as string, int, bool. This types are mapped to Sharepoint types without any issue.
    Now I what to use something more complex.
    [DataContract]
    public class Item
    [DataMember]
    public Guid Id { get; set; }
    [DataMember]
    public string Name { get; set; }
    [DataMember]
    public string Description { get; set; }
    [DataMember]
    public Uri Link { get; set; }
    I've added Link property of type Uri. By default this field does not appear in my list at all because, as far as I understand, sharepoint doesn't know how to map this property. I would like to map it to field of type Hyperlink or Picture.
    Is there any way to explicitly define to which type I want my property to be mapped to? I can use another type in my Item class if necessary.

    a URI and a SPHyperLink wouldn't directly match up... a SPHyperLink contains a URI and a description.
    BCS has a bit of trouble when it comes to complex types... your best bet is to stick with the supported primitives, and then convert to a hyperlink on the rendering side (custom list view, search results web part, etc).
    see: http://stackoverflow.com/questions/5399340/sharepoint-bcs-creating-a-hyperlink-column
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Access data from from two lists based on lookup columns and insert into another

    Hi,
    I am new in SharePoint and is stuck in some problem.
    I want to insert data in to a list by fetching data from 2 lists.
    The scenario is :
    List A Columns : EmployeeName, EmployeeID, EmployeeSalary 
    List B Columns : DepartmentName, EmployeeID, ManagerID
    EmployeeID is lookup column 
    I want to fetch data from these 2 lists and insert data into another list:
    List C Columns: EmployeeName, EmployeeSalary, DepartmentName 
    Can someone please explain me all the possible approaches to do the above task

    If ListA and ListB are the lists that you created, it would be better to generate the lists data into one list not seperate lists, as they both represents the property information of one employee.
    If they are existing lists, you may have following considerations:
    1. if you are a programmer, it would be easier to have a lookup column at ListA, to generate the EmployeeName, EmplyeeSalary, then using ItemAdded event, to generate the DepartmentName column based on EmployeeID column.
    2. have a lookup column look at ListA, use workflow, set when item is created, start the workflow automatically, then in the workflow, find ListB related item based on EmployeeID column, to set the DepartmentName column, SharePoint designer workflow
    set Item Value activity can do this work, you can research to find more information about how to do this.
    Thanks,
    Qiao Wei <br/> My blog:http://blog.goobol.com

  • Adding a column to a form in a meeting list

    Hi -
    I have a meeting list/calendar where I would like to add a column to the form that you get when you click to add a new meeting.  I have created the column already, but can't figure out how to make it appear in the pop up form.  I'm pretty new at
    all this, so I'm guessing I'm missing something simple?  I can add the column in other views, but I can't seem to get it to show up when you click the "add" button.
    Thanks,
    Amy

    Hi Amy,
    Open the ‘Event’ content type, and click your column under ‘Columns’ section, then click ‘Remove’ to  remove it from the form. After that, re-add the column into the ‘Event’ content type through clicking ‘Add from existing site or list columns’, compare
    the result.
    Please create a new column, and on the ‘Additional Column Settings’ section, select ‘Add to all content types’, test again, then compare the result.
    If this issue still exists , please create a new calendar, compare the result.
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to Fill list in excel based on another columns cell value

    Hello,
    I am facing issue while binding data to list i want to bind list or filter list based on another columns cell value

    If your list is a series of rows with column headers like the following:
    Column A
    Column B
    1
    Apple
    1
    Banana
    1
    Orange
    2
    Pineapple
    2
    Cucumber
    2
    Watermelon
    Then you can do this will Excel's built in filter functions. If you select the entire data table and then go to "DATA" then click the "FILTER" button a drop down will appear next to both headers (Column A and Column B in this case). You
    can then select the data you would like filtered from either column and Excel will hide that entire row.
    If this is not what you are looking for please post some examples of what you are trying to see.

  • Validate list column based on entry from another column

    Hi there
    I would like to ensure that a value is entered in list column B, if there is a value of 'Yes' in list column A.
    I assume this formula is entered in the Validation settings of the list, but cannot work out what is required.
    Is it something like?     =IF([Col-A]="Yes",IF(LEN([Col-B]<1,TRUE,FALSE),TRUE)
    Thanks
    Asher
    Fast, Cheap, Good. Choose any Two!

    Ahh, found a solution:
    =IF([Col-A]="Yes",IF([Col-B]<>"",TRUE,FALSE),TRUE)
    Now i need to do the same for other fields in the list, and these formulas must go together in the validation settings of the list, which is going to look messy.
    If i want to do the same with columns C and D, how would i append this to the formula?
    =IF([Col-C]="Yes",IF([Col-D]<>"",TRUE,FALSE),TRUE)
    Thanks
    Asher
    Fast, Cheap, Good. Choose any Two!

  • Dynamic form generation

    Dynamic NX form generation from recordset
    Quite often I've needed different forms (edit from an ADDT nextensio list)
    dependent on user level or company
    it would be very useful to be able to define the form fields from a recordset first
    rather than create individually tailored forms
    Paul

    Hi
    1. You're on the wrong forum. Please post on the LiveCycle designer forum.
    2. Use a Table or a repeating subform. Bind the table row to "persons[*]" and the column cells to person/first_name.
    Howard
    http://www.avoka.com

  • Filtering InfoPath Form Data Based on Sharepoint Login

    We have a form designed in InfoPath that updates a SharePoint list.  We've added a data connection in InfoPath to an SQL database that holds information we'd like to have populated in the form.  One of the columns in the database is username which
    matches the username someone accesses SharePoint with.  
    Our question is this - how can we add a filter or rule to our form so that when user x logs into Sharepoint, the form populates with all the data  in the SQL database for user x   
    We've been able to pull all the data into the form for each user, but not a specific user like we're trying to. 
    Any suggestions or reference would be most appreciated.  
    Thanks in advance. 

    Hello,
    As i understand, you want to get filter data from SQL based on current user name. You need to use "where" operator in SQL query to get specific user data from SQL. First create a SQL connection and overwrite query in your code. Refer this link for code:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/5aa4519c-b8e0-4a7c-85b4-09f7e1d0747a/dynamic-sql-data-connection-in-infopath?forum=sharepointcustomizationprevious
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Filter the secondary datasource based on lookup column

    Hello All,
    I am customizing a List form. I have a secondary data connection which is
    a datasource for my drop down list. I have to filter the datasource based on Lookup column value.
    I know how to filter on the datasource by going to entries and filtering but it does not work with Lookup column.
    Can anyone let me know step by step procedure.
    Regards,
    smith
    smith

    Hi,
    According to your post, my understanding is that you wanted to filter the secondary datasource based on lookup column.
    I recommend to create a cascading drop-down list box in InfoPath.
    You can follow the steps in the article to achieve what you want:
    Create Cascading Dropdown in Browser enabled InfoPath form using InfoPath 2010
    More information:
    Cascading Drop Down List In SharePoint 2010
    Cascading Drop-Down List in SharePoint 2010 using InfoPath 2010
    Dan's SharePoint Blog: InfoPath Tutorial Cascading Dropdown (Does not have the 20 item limit)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Passing Session Values to the Tabular Form Element of a Report Column

    Hello,
    I'm running application express version 2.0 with a 10.2.0.2.0 database on a 32 bit windows box. I'm trying to figure out sneaky a way to pass the &APP_PAGE_ID., #APP_PAGE_ID# or V('APP_PAGE_ID'); as an element attribute of a Report Tabular Form Element set to display as a Select List (named LOV).
    It seems that whatever option I choose, the Element Attributes field will only render the literal value of what I have entered. This is part of the solution but I would like to find a way to pass the current page id.
    What I'm trying to do is utilize the ONCHANGE attribute to redirect to a report page in my application when the value from a Select List (named LOV) is selected.
    I could work around this by creating my own table output with PL/SQL and HTP.P commands but would really be interested in finding out if I can use the reporting structures which are already available through Application Express.
    Any ideas?
    Thanks.
    Justin.

    Thanks for the response Earl. To clarify this is what I've done and what I hope to achieve:
    I currently have a LOV for my application that identifies a number of database report types: DB Options, DB Parameters, DB Version, and so on.
    I have an application express report being generated for the databases I'm monitoring and it displays as follows:
    - HOST -- DBTYPE -------- DBNAME - DBREPORTS
    =====================================
    - SVR 1 - Oracle 9.2.0.1 - DEV -------- [LOV HERE]
    - SVR 2 - Oracle 9.2.0.7 - TST --------- [LOV HERE]
    I am displaying the LOV on my report the the options under the reports attribute tab in my application builder. I insert my LOV select list by editing the DBREPORTS column and set the "Display As:" option under Tabular Form Element to "Select List (named LOV)"; I have also added my LOV to the "Named LOV" option under List of Values.
    So far this achieves everything I would expect and works quite well (a select list with my report types appears in my monitor report for each DB that is returned).
    What I'm interested in doing now is opening a DBREPORT for a given database by simply choosing the report type from my LOV. I can set the "Element Attributes" option under Tabular Form Element to execute a javascript call for any valid event (in my case I'm using ONCHANGE).
    My only issue is that I cannot find a way to pass any session values from my page to my Element Attribute. If, in the Element Attributes field I enter:
    onchange="alert(this.value);" //my dialogue box will display the value of my current selection when I choose a report type.
    What I'd love to be able to do is something like:
    onchange="alert('&APP_PAGE_ID.');" //so my current page id is written to the element.
    Unfortunately, only my literal text seems to be rendered. Rather than having my dialogue come back with my page number, say 75, I receive the literal value &APP_PAGE_ID.
    Notwithstanding any quote issues, I've tried to dump a test html attribute to my source html by entering any of the following in the Element Attributes field:
    test=&APP_PAGE_ID.
    test=#APP_PAGE_ID#
    and as a shot in the dark knowing that I'm not using PL/SQL:
    test=V('APP_PAGE_ID');
    In every case when I view source I see the literal value of what was entered in the Element Attributes field (ie "test=&APP_PAGE_ID." instead of "test=75").
    What makes things a little more frustrating is that I can drop &APP_PAGE_ID. into the Column Heading field (ex My Heading &APP_PAGE_ID.), it renders as I would expect; "My Heading 75". If we could find a solution to this, I could see a number of slick uses for this type of functionality.
    Hope this helps,
    Thanks.
    Justin.

  • How to filter the Rest Api data based on Taxanomy columns

    Hi Everyone,
    We are using SharePoint2010 Standard Edition.
    I wanted get the library details through REST Api. I am using as below:
    https://SiteUrl/_vti_bin/listdata.svc/Documents?$filter=Title eq 'SharePointDoc'
    Here I am able to get the info regarding "SharePointDoc". But when I am trying to get the details from Taxonomy filter, it didn't.
    Can anyone please tell me how can we filter based on Taxanomy fields.
    Thanks in Advance
    Krishnasandeep

    Hi,
    I understand that you wanted to filter the Rest Api data based on Taxanomy columns.
    Per my knowledge, in SharePoint 2010 , not all types of column are available via REST, most annoyingly managed metadata columns are amongst this group of unsupported column types.
    However, in SharePoint 2013, we can filter list items based on taxonomy (managed metadata) columns.
    Taxonomy fields can be now called via REST API using CAML query in REST calls.
    Here is a great blog for your reference:
    http://www.cleverworkarounds.com/2013/09/23/how-to-filter-on-a-managed-metadata-column-via-rest-in-sharepoint-2013/comment-page-1/
    You’d better to change the REST calls and the CAML query to check whether it works in SharePoint 2010.
    More information:
    http://platinumdogs.me/2013/03/14/sharepoint-adventures-with-the-rest-api-part-1/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Different links for different forms of the same list.

    Greetings,
    I have a custom list created with several columns one of which is the Title column. I have created three different views for this list.
    Using SharePoint Designer 2013 I have created three separate forms, one is a custom new for, a custom edit form and a custom display form. For specific reasons, I have not setup these forms as default. 
    I'd like to change the URL of the Title column depending on the view. 
    For example, if I am on View1 and click on the Title column, then I should see the custom display form I have built. In short, I want a way to manually change the url of the Title column. 
    I plan on creating several other forms for this same list and hence I need to know how I can change the URL of the Title column to match the need of the workflow.
    Thanks in advance.
    Daniel Christian (MCTS)

    May be you can achieve it using different java scipt for different views:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d7083056-594b-45b4-9fd4-9d615cdf5875/how-to-change-link-of-list-items-title-in-sharepoint-custom-list-by-programmatically-on-sharepoint?forum=appsforsharepoint
    However another suggest is that you create multiple title column with different links. every view will have a different title column so it can achieved.

  • How to create Web services to communicate InfoPath forms to Share Point lists ?

    How to create Web services to communicate InfoPath forms to Share Point lists ?

    Hi,  
     As per your posting and my understanding, you wanted to communicate your infopath with SharePoint list/library. Please refer the below link(s) which may help you to solve your issue.
    http://blogs.msdn.com/b/russmax/archive/2012/08/17/want-to-call-sharepoint-2010-web-services-within-browser-based-infopath-2010-forms.aspx
    http://jaliyaudagedara.blogspot.in/2011/03/submitting-data-to-sharepoint-2010-list.html
    or 
    http://blogs.msdn.com/b/infopath/archive/2007/03/26/submitting-to-a-sharepoint-list.aspx
    If you need more help please let usknow
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you
    see a reply being an answer to the question of the thread, click "Mark As Answer

  • Report "Display Text (Based on LOV)" columns don't like colons - Bug?

    This is a bit hard to explain in text, so I've built a sample app: http://apex.oracle.com/pls/otn/f?p=9608:1
    The app has two pages, which demonstrate two related bugs in the handling of Report "Display as Text (based on LOV)" columns.
    Basically, if the LOV query returns a string that contains colon characters (":") in the display column, the values are matched up correctly, but the colons are stripped from the display.
    If the LOV query returns a string that contains colon characters in the return value column, then the matching fails entirely.
    Removing the colon characters eliminates the problem.
    We actually ran into this in a production environment, after an upgrade from Apex 3.0.0 to 3.2.1. The behavior definitely did not occur in Apex 3.0, but was added at some point between the two versions.

    The colon is actually part of our data (the field in question is a URN namespace).
    And yes, I understand the function of the colon in Apex URL parameter passing. However, I wouldn't expect that sort of parsing to be used against the results returned from an LOV query.
    Also, the LOV is fine in of itself -- a select list based on the LOV displays & returns the expected values. It's only when I use a report column based on an LOV that this behavior creeps in.
    We've found a (fairly painful) workaround -- altering both the report query and the LOV query to to do something like replace(column, ':', '_') -- but that's a manual change to a large number of pages for us.
    This behavior is new to version 3.2.1. It didn't happen in version 3.0.

Maybe you are looking for

  • JMS Receiver Adapter Conversion.......

    Hi All, I am using JMS Receever Adapter for sending data to Mainframe MQ. The message converted to Fixed length format. At the end of every record I am getting "." Output of JMS Receiver Adapter abcde  ghijk  lmn      . hhffh    jhjghj jgjjggj   . df

  • SAP1602i with dhcp service!

    Hi, I am trying to have a setup where the AP running in autonomous mode also act dhcp server for the wireless clients. The only thing is that the vlan is switched across to the wired network. So basically i am having 2 vlans, one for mgmt and other f

  • Does Kodo 4.1 support embedded with the owner-field attribute?

    Does Kodo 4.1 support embedded with the owner-field attribute? My investigations so far say no, that it is infact ignored. This is a very serious problem for the project I am working on. Please proove me wrong...

  • Why do I get an error message when I want to send a letter to about 40 - 50 e-mail addresses?

    HI, Please, answer the question in the Object field. BRs Lajos

  • Printing a wide Interactive Report

    Hello, I have an interactive report which has more than 50 columns on it. In Firefox, when I send it to printer by selecting File/Print, it only prints first page while I am expecting it to print rest of the columns on the second page. Has anyone exp