Thread: WorkFlow on cgv
View Single Post
  #1 (permalink)  
Old September 24th, 2009, 05:05 PM
ZeroFactorial ZeroFactorial is offline
Authorized User
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default WorkFlow on cgv

Trying to implement WF into one of my pages. However it seems I can go to every page of the application except the page that contains the cgv. Everything is modeled fairly close. I made a few modifications to some classes, but this is the first time I am trying to implement WF.

When I try to go to the page with the cgv I get.

Sequence contains no elements 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Sequence contains no elements

Source Error: 

Line 27:                 if (eNTWFState != null)Line 28:                 {Line 29:                     return eNTWFState.Single();Line 30:                 }Line 31:                 else
privatevoid BindGridView(string sortExpression, SortDirection sortDirection)
//Create an instance of the list object
Type objectType = Type.GetType(ListClassName);
object listObject = Activator.CreateInstance(objectType);
//Call the method to load the object
//objectType.InvokeMember(LoadMethodName, BindingFlags.InvokeMethod, null, listObject, new object[] { });
objectType.InvokeMember(LoadMethodName, BindingFlags.InvokeMethod, null, listObject, _methodParameters.ToArray());
//Call the SortByPropertyName method. This is in the ENTBaseBOList class. The object must inherit
//from this class.
base.DataSource = objectType.InvokeMember("SortByPropertyName", BindingFlags.InvokeMethod, null, listObject, newobject[] { sortExpression, sortDirection == SortDirection.Ascending });
//Save the sortExpression and sortDirection to the view state.
SortExpressionLast = sortExpression;
SortDirectionLast = sortDirection;
objectType = null;
listObject = null;
I thnk it has something to do with the listobject in the bold line above. Any ideas are appreciated. Im going to go back to the EO for this object and compare.