Question

I have created a workflow with approval and reject process. whenever the document is approved it works fine but when rejected the process does not get rejected and the task is reassigned. I have used sequential workflow and on rejection i have used code activity to update the process and then the terminate activity. It shows as rejected but reassigns the task. Any Suggessions?

Was it helpful?

Solution

I have used Visual studio workflow. and this what happens at the rejection process.

enter code hereSPSite mySite = new SPSite(TaskDetails);
        SPWeb myweb = mySite.OpenWeb();
        if (TasksListstitle == "Request Form")
        {
            SPList myList = myweb.Lists["Request Form"];
            SPListItem myListItem = myList.GetItemById(TaskItemID);
            myListItem["Document Status"] = "Request Rejected";
            myListItem.Update();
        }
        if (TasksListstitle == "Contract Forms")
        {
            SPList myList1 = myweb.Lists["Contract Forms"];
            SPListItem myListItem1 = myList1.GetItemById(TaskItemID);
            myListItem1["Document Status"] = "Document Rejected";
            myListItem1.Update();

        }

After rejection i have used terminate activity process. sometimes Its getting reassigning without getting rejected and sometimes it gets rejected and terminate activity is called. I think there might be some problem with the ID.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top