Quantcast
Channel: Nintex Connect: Active Threads
Viewing all articles
Browse latest Browse all 4245

Server was unable to process request. ---> Cannot find list. (SPContext.Current.Web contains list).

$
0
0

Hello,

First I want to say I have searched this issue and found related issues, but did not find an answer to my issue. However I am hoping that someone will take a quick look at this issue and tell me I’ve overlooked something. I keep coming back to this issue expecting to find something I’ve missed, but after spending far too long without success I’m appealing to the forums.

I experience this issue in our development environment, but not on my virtual machine. Both are set up the with the root web containing a list called “Training” and a workflow called “Training Validation.” I’ve added a button to the display form to kick-off the workflow. Currently the workflow just logs to the history that it fired. It works flawlessly within my VM, but in our dev environment I get this error:

Server was unable to process request. ---> Cannot find list. Parameter name: listName Actual value was Training.

Special note, I can start the workflow from the list item by going through the workflows, selecting the workflow and clicking ‘Start’. The whole point of this effort however is to not require the user to do this to start the workflow.

In my experience, you get this error under two circumstances.

First, I’ve seen this error when the .nwf file was created on a list and then the list is changed. That is not the case here and I’ve recreated the workflow in the dev environment to ensure the “Training Validation” workflow was publishable (i.e. didn’t have issues because columns didn’t match). That’s also why the current workflow has been simplified to just log the workflow firing.

Second, as with the link above sometimes the service being called isn’t at the same level as the list.  When I look at what I’m doing though, I don’t see that being the issue (I hope I’m wrong). Here’s how I create my service (this is inside the button-click event on the item display form):

NintexWorkflowWS nintexWebService = newNintexWorkflowWS();

//Start with current web url

string webServiceUrl = SPContext.Current.Web.Url;

//make sure Web Service Url is well formed

if (!webServiceUrl.EndsWith("/")) webServiceUrl += "/";

//append the Nintex Web Service Url

webServiceUrl += "_vti_bin/nintexworkflow/workflow.asmx";

nintexWebService.Url = webServiceUrl;

nintexWebService.Credentials = GetNintexRunTimeCredentials();

nintexWebService.StartWorkflowOnListItem(itemId, listName, validationWorkflowName, "");             

A note about that last line, itemId gets Convert.ToInt32(Request.QueryString["ID"]), listName gets SPContext.Current.List.Title, which comes back as “Training”. Finally, validationWorkflowNameis a private string that returns"Training Validation".

 

I’ve gone so far as to grab the SPContext.Current.Web and have it log every list contained in the web when the call fails with the error saying it can’t find the list called Training. Training is listed.


Viewing all articles
Browse latest Browse all 4245

Trending Articles