Click here to Skip to main content
15,917,991 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Friends,

I'm new to sharepoint 2010. in my organization they given one small workflow to do.
I created the sequential workflow in that while updating main list i'm updating the tasks, the person whom to be assigned.In that i'm getting error occured message in Tasks during inserting in the main list using content type id.
In Log file its showing that value does not fall within range error..

Please help to resolve this last two weeks i'm struggling to resolve this issue.


Please check the below code which was working for create task event but not working for create task with content type id event

C#
private void createTaskWithContentType1_MethodInvoking(object sender, EventArgs e)
       {
           try
           {
               string assignedTo = GetHRUser_BUID(workflowProperties.Web, "HRDetails", "1");
               taskId = System.Guid.NewGuid();

               workflowTaskProperties.Title = "Input Approval Task";
               workflowTaskProperties.AssignedTo = assignedTo;
               workflowTaskProperties.StartDate = DateTime.Now;
               workflowTaskProperties.DueDate = DateTime.Now.AddDays(1.0);
               workflowTaskProperties.ExtendedProperties["ApproverLevel"] = "HRNAME";
               workflowTaskProperties.SendEmailNotification = true;
               // taskItemURL = workflowProperties.Web.Url + "/" + workflowProperties.TaskList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url + @"?ID=";
               HstDescription = string.Format("Workflow task has been created for {0}", assignedTo);
               HstOutcome = "Create task event has been competed.";


           }
           catch (ArgumentException ex1)
           {
               HstDescription = string.Format("EXCEPTION OCCURED; MESSAGE : {0} STACK TRACE :{1}", ex1.Message, ex1.StackTrace);
               HstOutcome = string.Format("EXCEPTION OCCURED; DETAILS : {0}", ex1.ToString());
           }
           catch (Exception ex)
           {
               HstDescription = string.Format("EXCEPTION OCCURED; MESSAGE : {0} STACK TRACE :{1}", ex.Message, ex.StackTrace);
               HstOutcome = string.Format("EXCEPTION OCCURED; DETAILS : {0}", ex.ToString());
           }
       }
Posted
Updated 5-Jun-12 21:33pm
v4
Comments
Sandeep Mewara 5-Jun-12 10:28am    
Sharing code might help here.
visnumca123 5-Jun-12 11:51am    
Hi sandeep please check the code and revert back!

1 solution

Hi all this is the error i missed out i went through the sharepoint manager and see the content type id there the event reciever url is not updated so i create the windows application and update that same now its working fine!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900