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

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

Disable an activity in Designer at run time in workflow 4.0

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :Windows Application
There are couple of activities in my workflow & based on some condition, I need to make an activity disabled i.e. I don't want that activity to be seletable by the user. I am opening my workflow in designer at run time to give an overview of WF to the user. Something like  (new DesignerMetadata()).Register(); this.wd = new System.Activities.Presentation.WorkflowDesigner(); this.designerSection.Child = (this.wd.View); I was going thru the MS sample of CommentOut Activity but that won't solve my requirement as Activity needs to be disabled at run time based on some condition.

View Complete Post

More Related Resource Links

how to send an email using sharepoint designer workflow when an item equals to end time

hi, How to trigger the workflow when current time is equl to end time. I need to send an document when  current time is equl to end time. I am using designer workflows(sharepoint 2007).I have created a variable and i am able to get todays date but not able to get time by default i am getting 12:00:00 Am.i want to get current time. can u please tell me.

Disable Expand All/Collapse All workflow designer hyperlinks?

Hi,In a blog post by Matt Winker (http://blogs.msdn.com/mwinkle/archive/2009/10/20/wf4-designer-enhancements-in-vs-2010-beta-2.aspx), he notes that: "Additionally, you can choose to expand or collapse individual nodes, or go to the "Expand All" command in order to expand out the tree.  One thing to note is that we don't allow expansion inside of a flowchart because we don't yet have a mechanism that lets me rearrange all of the items around that newly expanded activity.  "My question is, will there be a way by the time RTM releases to do expansion within a flow chart?  The flow chart model is what I'll be using exclusively, so I'm quite interesetd in this.If there will not be support by the time workflow reaches RTM, is there or will there be a way that we can hide the Expand All/Collapse All hyperlinks?Thank you,Notre

SharePoint Designer Workflow Activity to generate Word Document from Infopath xml




I am considering the follow implementation.

I have a workflow that user fills out to get funding and once approved (via workflow) I want to at the end of the approval generate the letter dynamically based on the values out of the infopath form.

Now I am thinking of the following solutions.

A custom activity where you point it to the word document to use and then set the fields out of the infopath that you want transfered into the word document.

Is this going to be even possible.

The type of data I have is fields from lookup, people pickers, text, curreny etc.

Is there another option maybe having a document lib with these fields as text and create new item in it and move these values into there (is that possible via designer?)


The document has to be able to be easily editable by the end user to change the template and also to be able to edit the actual document once created.


Any help would be great.

the joy of writing a custom workflow activity for SharePoint Designer...


So, I need an activity that will replace some old text into new text in a given string.
Not present OOTB in SharePoint Designer, so - oh boy! oh boy! - we can develop it ourselves using Visual Studio!

Ok great, I did some reading about it on SP2007 in the past, but never needed it, so never actually tried it.
Now I'm on SP2010, so I googled again to find guides on how to write my very first custom workflow activity to use in SharePoint Designer 2010.
Nothing to be found.... The few posts about 2010 were only stating that it works still the same as in SP2007, and to look for guides on 2007.

Ok, so I googled some guides on how to do this in SP2007. I found one from MSDN, perfect to start with you'd say: http://msdn.microsoft.com/en-us/library/cc627284.aspx 
But really, it doesn't work the same... When I create an Activity Library project in VS2010, I don't have a class, like in the guide. All I have is a xaml file, no cs at all, and I have absolutely no clue what I should add in order to get the same class as in the guide. Adding a regular class is not it, since in the guide they're using a partial class. So I'm blocked 5secs after I started reading the guide... just great.

I'm so fed up with the lack of information on development for SharePoint. I hit

Date Time issue in Sharepoint Designer workflow



I am trying to format the date in a Sharepoint workflow (using Sharepoint Designer 2007) so that it does not include the time.  Does anyone know how this can be done?


Any help greatly appriciated...



Srikanth Reddy




Publish a Workflow from SharePoint Designer takes more and more time



I started a workflow from scratch, and often while designing my workflow I save it & publish it to test it on my dev environment. However, the more I had actions, the longer it takes. I have now roughly 30 actions and condition (including Approval Process, Workflow Status and collect data), and it takes about 6 or 7 minutes to publish! Is this normal?



Julien http://www.sharepointofview.fr/Julien

Is there a plan to support a custom activity type as a root document in xaml on VS workflow designer



Referring to the post below. It seems that the current VS workflow designer only support "Activity" type as a root document. Is there a plan to support a custom activity type as a root document in xaml on next release of WF?




Hiding an activity in the windows workflow designer

Is there a way to hide an activity in the worflow designer even though that activity is part of a larger composite activity?


I have three activities: a, b, and c
Activity a performs function a
Activity b performs function b
Activity c performs function c

I have created a composite activity called activity abNc.  This activity performs the following steps:
function a
function b N times (specified in a loop activity)
function c

These three small activities can be reused in many other composite activities but really have no use to the end user by themselves.  The larger activity has a custom designer associated so the smaller activities do not appear when activity abNc is on the canvas. 

So I'm looking for a way to hide the activities in the available activities tree.  I've tried using the DesignTimeVisibileAttribute without success.  Does this not work because of the answer to this post: http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/thread/2ac10f8f-3582-4935-b72a-04bc6439a4aa
Or is there some other way to accomplish this that I'm overlooking?  Any help is greatly appreciated.

Thank you!

Custom Workflow Activity Designer Serialization Issues


I have an activity which has collection properties as below


    public sealed class TaskActivity : NativeActivity
        public TaskActivity()
            TaskParameters = new ObservableCollection<PMTaskParameter>();
            TaskExceptions = new ObservableCollection<Guid>();

ASP.NET Designer - How Do I generate this Design-Time Markup?


I want to generate this:
    <x:MyControl id="a" runat="server">
            <x:MyScript .. />

Trying to send email using Sharepoint Designer 2007 workflow and email enabled list


I have a a list that recieves email. I have few fields that shows me the originator: "E-Mail From" and "E-Mail Sender".

I am trying to create a workflow that will generate an auto reply to the originator but the SPD fails to recognize the email address in these two fields. It's either truncating part of it or uses the html ( href=mailto:Demo@DemoSomething.com) in the To field.

Thank you,


How can I implement this workflow scenario with SharePoint Designer?



I have a document content type and a library which contains this content type. here is what I want to do:

- when user creates a new document in this library, he will enter some user  names with people picker and then a message including some columns of the content type will be sent to that users. And then, at a certain date (lets say 1 day before a date that is one of the site columns) another email, a reminder will be sent.

I havent been able to find :

1- how can I replace a people picker field on workflow initiation form and how can I make it sent email to the user.

2- How can I make it sent a reminder email 1 day before the date that is stored in one of the columns of the content type(current item)

any help would be welcome,


Converting UTC to another Time... in XSLT SharePoint designer using ddwrt


I am not a programmer, nor do I know any coding languages.  I have a slightly above average understanding of how writing code works, so please keep that in mind when responding.... 

I am using a list in SharePoint; when the list is updated, I want to display "UPDATED w/ Date and Time".  I cannot figure out how to display the Local Afghanistan time vice UTC or Zulu time. I am trying to figure out what to add in to change the time displayed +4:30 hours.  I am currently using the following code in XSLT with SharePoint Designer:

<xsl:if test="ddwrt:FormatDate(string(@Modified), number(1033), 1)=ddwrt:FormatDate(ddwrt:TodayIso(), number(1033), 1)">

   <xsl:if test="ddwrt:FormatDate(string(@Modified), number(1033), 1)!=ddwrt:FormatDate(string(@Created), number(1033), 1)">

   <Span style="background-color:maroon;color:white">UPDATED <xsl:value-of disable-output-escaping="no" select="@Modified" /></span>



How to use display Text in Hyperlink For SharePoint 2010 Designer Workflow


In SharePoint 2007 Designer, I have used the Hyperlink column to store the link "http://www.sharepoint.com/Default.aspx, Details". The details text will be shown in the Hyperlink column. Everything works fine in sharepoint 2007 Designer workflow.

In SharePoint Designer 2010 Workflow, I used the same method but the hyperlink column is displaying the full text "http://www.sharepoint.com/Default.aspx, Details" instead of only Details


Video: Microsoft Visio 2010 and Microsoft SharePoint Designer 2010 Workflow

Learn the specific roles Visio 2010 and SharePoint Designer 2010 play in the development process and how these tools can be used in concert to create a workflow. (Length: 13:22)

How to Cancel a Workflow Activity - LogToHistoryListActivity


How can I cancel a LogToHistoryListActivity? I don't understand how to get access to the ActivityExecutionContext. I guess one way is to add an IfElse before entry to avoid the activity completely. Casting the sender object does not work. Help anyone?

  private void logToHistoryListActivity_WorkflowActivated_MethodInvoking(object sender, EventArgs e)
   LogToHistoryListActivity log = (LogToHistoryListActivity)sender;
   string msg = string.Format("Work Request has been SAVED by {0}. Awaiting submittal.", workflowProperties.Originator);
   WFHelper.LogMessageToHistoryList(log, msg, null);

TFS 2010:Testing Workflow 4.0 activity

Hi EveryOne, Is there any way to test the workflow activity with out queing the new build?Usually while working with TFS2008, we ll test the particular class  through console application by passing parameters. In TFS 2010 ,i need to test the workflow ?is there any way some thing like creating an object for workflow and calling through console application? Please  suggest me. Thanks & Regards, eswar reddy 
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