Display webpart based on list content

Hello,
Is is possible to either display a custom home page or a different web part based on if content exists in a list or not?
I have a list configured for data entry.  From that data, I use SQL reporting services to generate and display graphs and pretty stuff.
Is is possible, for when a user logs into sharepoint (2013), if they have not entered any data yet, then display the data entry form, or if they have already entered data, display the reporting services dashboards?
Andrew Huddleston | Hillsong Church | Sydney

You can use javascript client object model to first check if the current logged in user has the data entered in the list on page load and onsuccess method of your javascript async call you can check if you have retrieved any count for the user in the list.
If data exists then using jquery either show your reporting webpart or hide it and instead show your data entry form. Below are some pointers
http://sharepoint.stackexchange.com/questions/73032/get-current-user-in-client-object-model-with-javascript
http://social.technet.microsoft.com/Forums/sharepoint/en-US/c437ecc4-c757-483f-8175-f92860d184be/hideshow-webpart-data-on-buttonclick-using-jquery?forum=sharepointgeneralprevious
http://msdn.microsoft.com/en-us/library/office/jj163201%28v=office.15%29.aspx#BasicOps_SPListItemTasks
Geetanjali Arora | My blogs |

Similar Messages

  • Automatically update 2 dimensional array based on list content

    Suppose I have a simple class named SimplePoint
    class SimplePoint
    public int x { get; set; }
    public int y { get; set; }
    Next I create an ObservableCollection of the class and bind it to a WPF DataGrid via XAML.
    Each SimplePoint has a distance to each other SimplePoint int the list, resulting in a matrix. The distance from point a to b can be different from the distance from point b to a (ie. different route).Distances should be editable.
    I wonder how I can create a class, that can automatically keep track of changes in the ObservableCollection<SimplePoint>. When a new SimplePoint is added, one row and one column should be added to the distances matrix. When a SimpePoint is removed,
    the appropriate entries in the matrix should be removed. Later I also wish to store and retrieve all the info to and from an XML via serialization.
    So this list:
    point1
    point2
    point3
    Would yield a 3x3 matrix of distances.
    Searching a lot did not yield results, though I am unsure if I looked for the right thing. I cannot get my head around how to organize this internally. Maybe something like ObservableCollection<ObservableCollection<SimplePoint>>, but then how
    to maintain that, and how to bind it to a DataGrid... Any ideas?

    Hi mennowo,
    >> that can automatically keep track of changes in the ObservableCollection<SimplePoint>. When a new SimplePoint is added, one row and one column should be added to the distances matrix
    I would recommend that you can use ObservableCollection<T>.CollectionChanged event:
    https://msdn.microsoft.com/en-us/library/ms653375(v=vs.110).aspx
    This event will be triggered when items are added, removed, changed, moved, or the entire list is refreshed. In this event, you can easily add item into the distances matrix as you wish.
    Here is a simple sample:
    public ObservableCollection<SimplePoint> DemoSource { get; set; }
    public MainWindow()
    InitializeComponent();
    DemoSource = new ObservableCollection<SimplePoint>();
    DemoSource.CollectionChanged += MyItemsSource_CollectionChanged;
    DemoSource.Add(new SimplePoint() { x = 1, y = 1 });
    DemoSource.Add(new SimplePoint() { x = 2, y = 2 });
    DemoSource.Add(new SimplePoint() { x = 3, y = 3 });
    this.DataContext = this;
    private void MyItemsSource_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
    if (e.NewItems != null)
    foreach (SimplePoint item in e.NewItems)
    //Add this item into the distances matrix
    if (e.OldItems != null)
    foreach (SimplePoint item in e.OldItems)
    //Do something for old items
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Choose display template based on result type - Content search webpart

    Hi 
    Is it possible to choose display template based on result type in content search webpart same like search results web part? If not available can it be achieved programmatically?
    The content search web part is queried against document content type. Based on the document type, the document has to be seen in the hover template.
    Please advise.

    Hi,
    From your description, my understanding is that you want to choose display template based on result type as search result Webpart in Content Search Webpart.
    You could customize your display template for Content Search Web Part, please refer to this article:
    http://www.benprins.net/2014/05/21/sharepoint-2013-custom-display-template-for-content-by-search-web-part/
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Help in BPM: Routing data to mutiple receivers based on field content

    Hi All
    I have a scenario where my source data is from a file. Typically this file is from a DMS application and based on the contents in this file i need to send the data to 2 receivers which might be R/3 and DB or file. Though BPM may not be of use for this scenariuo i want to make use of BPM:
    Q: My file content looks like:
    1200,fombell,12,1200.50,ea,tetra
    1900,fombell wdc,2,200,ea,magneta
    2020,morris,1,12.50,Pc,frp_films
    2020,morris,10,1200,Pc,xr_tutos
    field separator is  ,
    primarily my first field is a plant and based on the plant i need to send the data to R3 and File or DB. If i make use of switch in BPM i'm not able to read the entire list of the message. it checks only for the last record. how to goahead with this and kidnly let me know in details the steps involved.
    Thks
    Prabhu

    Hi Prabhu,
    Just to suggest i guess its always better to avoid BPMs to improve your performance...
    Your requirement can be easily met using the Extended Reciever determination that we have...
    Here actually based on condition from the message in the payload u can assign your receivers..
    Below is the steps to do the same...
    Under Receiver Determination --> Configured Receivers --> Specify the 2 receivers and beside the same you have an option called condition, there you specify the condition on which it has to go to the first system and then the condition on which it has to go to the second system.
    When you click on the codition it will open another window (Condition Editor window) under which you have a Left Operand which when you click will open up another window(Expression Editor window), there for your need you check on the XPath radio button and then click on the field whose value you wanna check from the structure that it displays, when you click on the field it fills in the XPath Expression, then click ok.
    After that it takes you back to the previous window(Condition Editor window) with the Left Operand having the XPath Expression, so all you will have to do is to fill the Right Operand which is nothing but the value you want that field to contain.(For Example if a field "A" that you have selected which comes in the XPath Expression in ur Left Operand,has a value "1" in your Right Operand)
    There you also have an option to put in an "and" or an "or" condition if required(For Example if you wanna check if "A" and "B" is satisfied or it you wanna check if "A" or "B" is satisfied, this can also be done)
    I also suggest u to go through these blogs..
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    If you have any doubts or clarifications on the same, please do ask and i will tell you how to proceed.
    Regards,
    Abhy

  • Screen dims in itunes based on video content

    When watching a video in iTunes my screen dims based on the content of the video to such a level that it's very hard to see anything. This only happens when the content of the video is actually dark at the moment (eg shadows, at night). When the content of the video switches back to something brighter (eg daylight) the brightness is going up again and everything is fine.
    When the screen goes dark and I move the mouse (to bring up the player controls), the screen switches back to bright right away. Until the controls go away, then the screen goes back to dark. I've also tried to play the video in other player and the same problem doesn't appear. Interesting to note is also that this only happens when playing videos in itunes in full screen, when the player isn't in full screen the screen doesn't dim.
    I've checked the energy saver and accessibility settings and nothing is set to dim the display. I've also turned off any energy saving settings on my tv. However, as this only happens in itunes and not with VLC I don't think this would be causing the problem anyway.
    I'm using OS X Mavericks on a Mac Mini connected to a Samsung tv via HDMI.
    Any help would be very much appreciated.

    I just upgraded my tv from 55" led samsung tv 1080p 120hz, to a newer model samsung with the same specs but with smart capabilities. I've noticed that since the swapping of TVs, the dimming isn't nearly as prominent. While the dimming still happens, tweaking the settings of the tv may help out a bit. I know that on some of the movies/tv shows I've watched with the old settings, in especially dark scenes (horror and thrillers mostly) much of the experience was lost due to the inability to make out images on the screen because of the darkness. I'm still searching for solutions, and trying different things. It may help if we all post a list of what we are using, and any other info that might prove useful. Maybe we all having a setting turned in that is causing this.
    TV= 55" Samsung 1080p 120Hz
    Connection to TV = Rocketfish brand HDMI to Mini
    - iTunes library is stored on a 4Tb hard drive to play content through computer. I pull content from the hard drive, I don't stream wirelessly.
    - in iTunes I have the playback video set to always be on top of other windows, as well as in a separate window unless the window is full screened.
    - my computer sleeps after 15 minutes. I can't remember if I have tried turning off the sleep function; however, I don't think this is what is effecting the playback because the dimming takes place in just a few seconds, rather than several minutes.
    I have worked with Apple Support and tried several solutions suggested. I attempted to create a second user to confirm that it wasn't a setting I had changed for my personal login that was causing the dimming. I have re-installed iTunes and restored to default settings. I was told that maybe apps I had running in the background such as WJoY or Caffeine could possibly be causing interference, turning these background apps off didn't change anything.
    Like I said, changing some of the settings on my TV helped. The only other work around that I might suggest until we find a solution, is moving the playback bar with the volume and ff/rw and play buttons to the corners utensil you can only see a small sliver, then leaving the cursor on top of the playback bar. This causes the bar to stay visible and not hide, whilst keeping mostly everything out of site. You'll still have the close screen (X) in the top left of the screen, and also be able to see the playback bar just a little bit, but it is better than nothing.

  • Search for documents using External Data on list content type

    hi,
    say we have clients in an external database, we create the external content type for use in sharepoint 2013
    we create two content types, Quote and Order for use in a library
    we create a document library that uses the above content types
    we then add a column for the external data ( in this case Client Name- but also include ID) , we have the option to copy to content type selected. so now library shows 'Client' and 'Client:ID'
    I believe that column gets added to  list content types based on the 2 document content types.
    so we have list items , which have a document , a content type and a piece of data from the external LOB system.
    now that is fine, works great, however, how do you configure the content search web part to return documents based on the piece of external data - ie client:ID ? or Client Name ?
    I can map the client:ID to one of the Int00 managed properties and crawl etc - but do not see a way to use that to return documents
    any help would be appreciated :)
    thanks
    MrP

    Create a scopr with that in managed properies and then u can get results from  external sources

  • Display sales orders due list in a week

    hi , i want to display sales orders due list in a week
    what are the tables need to be referred?
    Rgds
    Umakanth
    Edited by: Alvaro Tejada Galindo on Feb 21, 2008 5:06 PM

    Hi,
    The following is a list of Sales & Distribution tables :
    VBBE Sales Requirements: Individual Records
    VBEH Schedule line history
    VBEP Sales Document: Schedule Line Data
    VBFA Sales Document Flow
    VBLB Sales document: Release order data
    KONV Conditions for Transaction Data 
    KONP Conditions for Items 
    LIKP Delivery Header Data
    LIPS Delivery: Item data
    VBAK Sales Document: Header Data
    VBAP Sales Document: Item Data
    VBLK SD Document: Delivery Note Header
    VBPA Sales Document: Partner
    VBRK Billing: Header Data
    VBRP Billing: Item Data
    VBUK Sales Document: Header Status and
    Administrative Data
    VBUP Sales Document: Item Status
    VEKP Handling Unit - Header Table
    VEPO Packing: Handling Unit Item (Contents)
    VEPVG Delivery Due Index.
    Hope this might help you.
    Regards,
    Kaveri.

  • Reading text file and display in the selectOnechoice list item In ADF.

    Hi,
    I have a requirement to read the text field which have list of strings and that string display in the SelectOneChoice List item component on page load.
    I am using Jdeveloper 11.1.2.3 version.
    Any suggestion will highly appreciated..
    Thanks in advance.
    Regards

    Hi,
    Google will produce you with hints on how to read content of a file from Java (ideally the file uses some delimiter). Then in a managed bean, you read the file and save its content in a list of SelectItem. So your managed bean should have the following property and setter/getter pairs
    ArrayList<SelectItem> listFromFile = new ArrayList<SelectItem>();
    public void setListFromFile(ArrayList l){ //you don't need this }
    public ArrayList<SelectItem> getListFromFile(){
       //read file content and iterate over the file list entries
      for(i=0, i < fileContent.length, ++i){
         SelectItem si = new SelectItem();
         si.setValue(... the value to update the list of value with ...);
         si.setLabel("... the label to show in the list ...");
         listFromFile.add(si);
      return listFromFile;
    }The af:selectOneChoice component should look as follows
    <af:selectOneChoice id=".." value="...attribute to update with selection ..." ...>
       <f:selectItems value="#{managedBean.listFromFile}"/>
    </af:selectOneChoice>Frank

  • How to display all the surveys using content query web part

    Can you please tell me how to display all the surveys using content query web part in more details? I also created a subsite and multiple surveys in that site. Then, I inserted a Content Query Web Part and select the List Type to be "Survey",
    however, it returned nothing. Did I miss anything?

    Hi,
    OOTB Survey List does not contain any
    Content Types and it has the following structure:
    Response entry is represented by
    List Item
    Response entry consist of questions and answers, where Question correspond to
    Field and Answer to Item value respectively.
    For querying Survey List via CQWP  the following properties could be used
    BaseType 
    <Lists BaseType="4">
    ServerTemplate
    <Lists ServerTemplate="102">
    Example
    To retrieve all the responses from Survey lists, specify List Type property as shown on picture
    Reference:
    http://stackoverflow.com/questions/17280778/display-all-surveys-using-content-query-web-part
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • I have a survey sharepoint list, now i want to create a webpart using this list.

    Hi All,
    i have a survey sharepoint list, now i want to create a webpart using this list.
    webpart is to "display one question from survey sharepoint list(latest question)" and enduser participate on the survey when enduser submits the question(survey), save the result in to the list and result will display as graphical representation.
    How can i do this requirement, any help?

    You do not need to create a custom web part if you need to show the latest question and then display result in graphical way. The Survey list gives that OOTB.
    If there is a specific requirement, you can use Server/Client Object Model and achieve it.

  • How to display grid lines in list view please help

    Hello,
    What should I do if I would like do display grid lines in list view. I've read related topics but I stil don't know how to do it. I use Sharepoint Designer. Please help
    Regards

    Hi,
    You need to modify default XSLT of listview webpart. Open your page in designer and use below jquery.
    <!–ADJUST TABLE COLUMN WIDTH–>
    <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js“></script>
    <script>
    $(function(){
    $(“tr.ms-viewheadertr th:contains(‘Title’)”, “#MSO_ContentTable”).css(“width”, “50px”);
    $(“tr.ms-viewheadertr th:contains(‘Assigned To’)”, “#MSO_ContentTable”).css(“width”, “300px”);
    </script>
    Check this for more info about steps:
    http://jshidell.com/2010/09/19/adjusting-sharepoint-list-columns-using-jquery/
    You can also look into this MSDN article for more customization:
    http://msdn.microsoft.com/en-us/library/ff630941.aspx#odc_sp14_qn_UsingSharePointDesigner2010WorkwithWebParts_CreateXSLTListViewWebPart.
    Hope it could help
    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"

  • List content type columns don't show new names after resource files were changed

    Hello,
    we ran into a problem, that we're not able to figure out at the moment.
    We have a site collection with site columns and site content types defined and created with
    features ant their XML files. All display names are retrieved from resource files. We do have
    several subsites, that have predefined lists also created from features and their corresponding
    XML files. They use inherited versions of these site content types as list content types with
    their columns inherited from the site columns.
    We had some changes within the resource files and never ran into a problem up to now.
    We changed the display names of some of these columns within the resource files. After
    these changes the site columns, site content types and list columns show the changes
    as planned. Unfortunately the columns of the list content types do not display the changes.
    They still show the old name. If you try to alter the old names manually the new name is
    shown within the form, but you're not able to save it and the list content type columns
    still have their old name afterwards.
    We checked our definition files and they seemed to be well.
    Any ideas?
    Regards,
    Markus
    List columns as defined within new the resource file:
    List content type columns, that do not show the changes from the new resource file:

    Hi,
    According to your post, my understanding is that you want to modify the site column name in the list.
    I try to reproduce the issue, however, everything works well.
    You can modify the DisplayName in the Element.xml file.
    Then after you redeploy the project, the site column name will be changed in the list setting page.
    In addition, please check whether you create the list correctly.
    For more information, you can refer to
    Walkthrough: Create a Site Column, Content Type, and List for SharePoint
    Thanks,
    Linda Li                
    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]
    Linda Li
    TechNet Community Support

  • How to copy a page( webpart page) with its content using client side.

    How to copy a page(in my case  webpart page) with its content(it may contain webparts) using client code (i mean using SPservices or ECMA script).
    What i am planning is ,to give end user a page where it will contain text box to specify  name of page and a button with the help of  content editor webpart.
    where on click of button we need to write client side code such that it should create a new page from a existing page in a library with given name by user.
    Any suggestion would be helpful. For your information we can do it through UI with the help Site Actions / Manage Content and Structure.But i want to automate it using client side code.Server side code is restricted.
    or can we create a template of an existing page with content without the help of sharepoint designer.
    Thanks in advance
    with regards Ravichandra

    This is good example
    http://balajiindia.wordpress.com/2011/05/27/using-jquery-with-custom-web-services-in-sharepoint/
    Create web service
    http://balajiindia.wordpress.com/2011/05/27/using-jquery-with-custom-web-services-in-sharepoint/. Create method "Create Page" http://www.learningsharepoint.com/2010/09/17/create-publishing-pages-sharepoint-2010-programmatically/
    Build your Java Script. You can use Content Editor Web Part if you want to avoid custom web part development http://www.codeproject.com/Articles/544538/JQuery-with-SharePoint
    Oleg

  • How can we display Alerts based on Exceptions in BI7

    Hi,
    <b>How can we display Alerts based on Exceptions in BI7?</b> My requirement is a dashboard kind of scenario where the alerts will be displayed using WAD in Portal.
    In 3.5, we used to schedule the alerts from the Reporting Agent and display that using the Alert Webitem in Web Application Designer. But I couldn't find the Reporting Agent and the Alert Webitem in BI7. I would like to know how we can do Exception Reporting in BI7. I appreciate your suggestions/comments. Thanks in advance.
    Regards
    Hari

    Hi,
    Please go through this link:
    bw 7.0
    Regards,
    Habeeb

  • Deploying a Reusable Workflow to a List Content Type using PowerShell

    We have a situation where deployment of a reusable workflow for a site content type cannot be completed through the web interface due to the number of libraries where the content type is in use (time-out on deploy and update).
    It was hoped that this could be accomplished with PowerShell but the method of deploying to a list content type appears to be different than it is to a list (all content types).
    The below snippet works fine for a list / all content types:
    function AddWorkflowToLibraries ($SiteCollection, $ctName, $WfName, $WfAssociationName)
    $site = Get-SPSite $SiteCollection
    [Guid]$wfTemplateId = New-Object Guid
    #Step through each web in site collection
    $site | Get-SPWeb -limit all | ForEach-Object {
    $web = $_
    $_.Lists | ForEach-Object{
    if($_.AllowContentTypes -eq $true)
    if($_.ContentTypes.Item("$ctName") -ne $null)
    write-host "Enabling workflow on" $_.Title "in" $_.ParentWebUrl
    $ct = $_.ContentTypes[$ctName]
    $culture = New-Object System.Globalization.CultureInfo("en-US")
    $template = $site.RootWeb.WorkflowTemplates.GetTemplateByName($WfName, $culture)
    if($template -ne $null)
    $tasklist = "Tasks"
    $historylist = "Workflow History"
    if(!$web.Lists[$historylist])
    $web.Lists.Add($historylist, "A system library used to store workflow history information that is created in this site. It is created by the Publishing feature.",
    "WorkflowHistory", "00BFEA71-4EA5-48D4-A4AD-305CF7030140", 140, "100")
    if (!$web.Features["00BFEA71-4EA5-48D4-A4AD-305CF7030140"]) {
    Enable-SPFeature -Identity WorkflowHistoryList -Url $web.Url
    $wfHistory = $web.Lists[$historylist]
    $wfHistory.Hidden = $true
    $wfHistory.Update()
    if(!$web.Lists[$tasklist])
    $web.Lists.Add($tasklist, "This system library was created by the Publishing feature to store workflow tasks that are created in this site.", "WorkflowTasks", "00BFEA71-A83E-497E-9BA0-7A5C597D0107", 107, "100")
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.AddWorkflowAssociation($association)
    $_.Update()
    else
    Write-Error "Workflow Template not found"
    AddWorkflowToLibraries <Site Name> <Content Type Name> <Workflow Template Name> <Association Name>
    However changing the association as follows causes the script to still execute without a problem but the workflow doesn't appear for the content and the associations collection is empty:
    function AddWorkflowToLibraries ($SiteCollection, $ctName, $WfName, $WfAssociationName)
    $site = Get-SPSite $SiteCollection
    [Guid]$wfTemplateId = New-Object Guid
    #Step through each web in site collection
    $site | Get-SPWeb -limit all | ForEach-Object {
    $web = $_
    $_.Lists | ForEach-Object{
    if($_.AllowContentTypes -eq $true)
    if($_.ContentTypes.Item("$ctName") -ne $null)
    write-host "Enabling workflow on" $_.Title "in" $_.ParentWebUrl
    $ct = $_.ContentTypes[$ctName]
    $culture = New-Object System.Globalization.CultureInfo("en-US")
    $template = $site.RootWeb.WorkflowTemplates.GetTemplateByName($WfName, $culture)
    if($template -ne $null)
    $tasklist = "Tasks"
    $historylist = "Workflow History"
    if(!$web.Lists[$historylist])
    $web.Lists.Add($historylist, "A system library used to store workflow history information that is created in this site. It is created by the Publishing feature.",
    "WorkflowHistory", "00BFEA71-4EA5-48D4-A4AD-305CF7030140", 140, "100")
    if (!$web.Features["00BFEA71-4EA5-48D4-A4AD-305CF7030140"]) {
    Enable-SPFeature -Identity WorkflowHistoryList -Url $web.Url
    $wfHistory = $web.Lists[$historylist]
    $wfHistory.Hidden = $true
    $wfHistory.Update()
    if(!$web.Lists[$tasklist])
    $web.Lists.Add($tasklist, "This system library was created by the Publishing feature to store workflow tasks that are created in this site.", "WorkflowTasks", "00BFEA71-A83E-497E-9BA0-7A5C597D0107", 107, "100")
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.ContentTypes[$ctname].AddWorkflowAssociation($association)
    $_.ContentTypes[$ctname].Update()
    else
    Write-Error "Workflow Template not found"
    AddWorkflowToLibraries <Site Name> <Content Type Name> <Workflow Template Name> <Association Name>
    The only change is:
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.ContentTypes[$ctname].AddWorkflowAssociation($association)
    $_.ContentTypes[$ctname].Update()
    But unlike the list version, the association doesn't appear to be saved and no error is generated.
    Is anyone aware of what may cause this or have an example in C# that may explain something my script is missing?

    Hi Garry,
    After you associate the workflow to the content type, you should update the update the content type using
    $ct.UpdateWorkflowAssociationsOnChildren($true,$true,$true,$false)
     method.
    Here is the completed script:
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $site=Get-SPSite "http://serverName"
    $web=$site.OpenWeb()
    $list=$web.Lists["ListC"]
    $taskList=$web.Lists["Tasks"]
    $historyList=$web.Lists["Workflow History"]
    $ct=$list.ContentTypes["Link"]
    $culture=New-Object System.Globalization.CultureInfo("en-US")
    $wfTemplate=$web.WorkflowTemplates.GetTemplateByName("Three-State",$culture)
    $associationWF=[Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($wfTemplate, "myThreeStateWF",$taskList,$historyList)
    $ct.WorkflowAssociations.Add($associationWF)
    $ct.UpdateWorkflowAssociationsOnChildren($true,$true,$true,$false)
    Here is a demo about how to update it using C#
    http://www.thorntontechnical.com/tech/sharepoint/sharepoint-2010-associate-workflow-to-content-type-in-a-feature
    Wayne Fan
    TechNet Community Support

Maybe you are looking for

  • Performance Issue For Opening And Closing Balance In FBL1N/3N/5N

    Dear experts,                     I Am Having Requirement to Bring Opening And Closing Balance In FBL1N, FBL3N, FBL5N. For This requirement I Used BADI : FI_ITEMS_CH_DATA~CHANGE_ITEMS, below is my Code For FBL1N, And I've Done the same For 3N/5N...Wi

  • Copy a page from one page group to another

    Hi Is it possible to copy a page from one page group to another? Regards, Lene

  • Question on RAC on SAN

    Hi all, can sombody tell me if we are using SAN as a shared storage do we get raw devices as mpunt points or do we get iscsi deices? what we will the partition types we get when we use SAN as our storage? Thanks Maverick

  • Is there a way to turn off preview extractions?

    I had a collection of just under 500 photos, mostly raw and dng.  I selected them all with the intent of updating the metadata.  Bridge started creating preview extractions, and I had to wait, and wait, and wait for my metadatadaa updates to take eff

  • Confidential document

    I was able to access the following document via searching OTN. Article-ID: <Note:158367.1> Circulation: REVIEW_READY (INTERNAL) ***Oracle Confidential - Internal Use Only*** Folder: server.Internals.Corruption Topic: Articles to be Refiled Title: Ora