Error on create case

Jul 29, 2010 at 7:01 PM

I am trying to create a test case through the portal and the page cannot be displayed.  I am seeing the following error in my event logs:
      at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate) at Site.Pages.eService.CreateCase.CreateButton_Click(Object sender, EventArgs e) in C:\Users\reubenk.REDMOND\Documents\Dynamics CRM\Accelerators\Portals\Partner Portal R1.01\PARTNER_PORTAL_RTW_R1.01\Installation\Website\Partner-Portal-R2\Website\Pages\CreateCase.aspx.cs:line 41 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)



Where is the reference to C:\Users\reubenk.REDMOND\Documents\Dynamics CRM\Accelerators\Portals\Partner Portal R1.01\PARTNER_PORTAL_RTW_R1.01\Installation\Website\Partner-Portal-R2\Website\Pages\CreateCase.aspx.cs ??  I cannot seem to find it at all!

Aug 13, 2010 at 1:07 AM

Is there workaround for this issue?  this pretty much kills this plugin for us...

Aug 13, 2010 at 1:16 AM

I don't have the code in front of me right now, but the error is thrown on line 41 of the /Pages/CreateCase.aspx.cs file.  I suspect that there is some data in your CRM that is not set up properly, and when the SDK goes to create the case, something is not quite right.  This works in every other deployment I have seen, so I would suggest that you look at your deployment and your CRM to see what is going on.  I would also recommend attaching a debugger in Visual Studio 2008 to your website and stepping through the code-behind.  Your problem will be easy to spot that way.

As far as the path to the file, just look in the website root.  The longer path is because that was where it was last compiled and that information is in the PDB file.  If you compile the site in Visual Studio, your own paths will be in the next error message.


Aug 13, 2010 at 2:41 AM

this the line that errorsr:

var subjectid = context.Subjects.First(s => ((subject)s).title == SiteContext.Current.Website.GetSiteSettingValueByName("case/subject")).Id;


I will look into the debugger item.  I am not a developer, so this is certainly a learning experience.  I appreciate you assistance!

Aug 13, 2010 at 5:15 AM

OK, that code doesn't do any error checking.

There is a value that is in the Site Setting (a crm entity) with the name "case/subject".  The code looks for a subject with that value and then tries to set the subject for the case to that one.  This is to make the case easy to find.  What is likely happening is that you have not yet configured your subject heirarchy and made sure that this value matches the subject.  I believe this is covered in the portal config documentation.  Simply configure a subject that you want to use for cases, and ensure that the value of the site setting is set to your subject name and the code should work.