[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Wss3

Posted on 2011-05-02
4
Medium Priority
?
420 Views
Last Modified: 2012-05-11
when i create workflow,and using deleteTask method: I got error occur with my workflow in wss3 site,
it said error occur in workflow:
the code that I use :

using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using System.Windows.Forms;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using Microsoft.SharePoint.WorkflowActions;


namespace deleted
{
    public sealed partial class Workflow1 : SequentialWorkflowActivity
    {
        public Workflow1()
        {
            InitializeComponent();
        }

        public Guid workflowId = default(System.Guid);
        public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();

        private void deleteTask1_MethodInvoking(object sender, EventArgs e)
           
        {
           

            if (workflowProperties.Item.Title.ToString() == "Dara")
            {
                workflowProperties.Item.Delete();

            }
            else
            {
                string title="Invent";

               

                title=workflowProperties.Item.Title.ToString();



            }

        }

        private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
        {

        }
    }


       
   
}
 
0
Comment
Question by:manich
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 35508071
Are  you able to trace through it ?

Also are you able to build the project ok.
I am not sure you can declare a variable inside the else statement

 string title="Invent";

you may want to put that up by the method header

 private void deleteTask1_MethodInvoking(object sender, EventArgs e)        

        {
          string title="Invent";
0
 

Author Comment

by:manich
ID: 35530196
Can you give me the hold thing with condition in method deletetask() , cause when do condition on it , it 's not work.
0
 
LVL 14

Accepted Solution

by:
GeorgeGergues earned 1500 total points
ID: 35689554
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using System.Windows.Forms;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using Microsoft.SharePoint.WorkflowActions;


namespace deleted
{
    public sealed partial class Workflow1 : SequentialWorkflowActivity
    {
        public Workflow1()
        {
            InitializeComponent();
        }

        public Guid workflowId = default(System.Guid);
        public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();

        private void deleteTask1_MethodInvoking(object sender, EventArgs e)
           
        {
              string title="";
           

            if (workflowProperties.Item.Title.ToString() == "Dara")
            {
                workflowProperties.Item.Delete();

            }
            else
            {
                title="Invent";

               

                title=workflowProperties.Item.Title.ToString();



            }

        }

        private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
        {

        }
    }


       
   
}
0
 

Author Closing Comment

by:manich
ID: 35735073
want more expression in Deletetask,and so on via C# code
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question