Answered by:
Customer Portal 2011 - Error when creating a case

Question
-
Using the latest CRM 2011 Demo image with Customer Portal installed. All seems to work fine except for creating a case. The Title, Case Type and Description fields are filled in. When a user clicks the Create Case button the error below is generated:
Server Error in '/' Application.
Sequence contains no elements
Line 28: PriorityCode.SelectedValue = PriorityCode.Items.FindByText(ServiceContext.GetSiteSettingValueByName(Website, "case/prioritycode")).Value; Line 29: Line 30: var subject = XrmContext.SubjectSet.First(s => s.Title == ServiceContext.GetSiteSettingValueByName(Website, "case/subject")); Line 31: Line 32: var incident = new Incident
Source File: C:\Portals\CustomerPortal\CustomerPortal\Web\Pages\eService\CreateCase.aspx.cs Line: 30
Stack Trace:
[InvalidOperationException: Sequence contains no elements] Microsoft.Xrm.Sdk.Linq.QueryProvider.ThrowException(Exception exception) +12 Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups, String& pagingCookie, Boolean& moreRecords) +489 Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups) +131 Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(Expression expression) +216 Microsoft.Xrm.Sdk.Linq.QueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +85 System.Linq.Queryable.First(IQueryable`1 source, Expression`1 predicate) +590 Site.Pages.eService.CreateCase.CreateButton_Click(Object sender, EventArgs e) in C:\Portals\CustomerPortal\CustomerPortal\Web\Pages\eService\CreateCase.aspx.cs:30 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
MikeSunday, September 11, 2011 5:04 PM
Answers
-
The case entity requires a subject in CRM. What subject you use is irrelevent, just that you have to have a subject. Most organizations configure their subject heirarchy to make sense to their support system. The portal needs to know which subject to use when it inserts a new case, so it reads the value from a site setting. If you have an english install of CRM and you have not configured your subject tree, you could simply put "default subject" into the site setting.
Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com- Marked as answer by Palak Kadakia Monday, January 23, 2012 2:42 AM
Saturday, November 12, 2011 3:27 PMModerator -
I just had this happen to me.
The error is likely the result of a user changing the name of a subject that is also set as your site setting case/subject. You can find the site setting case/subject in Content Management -> Site Settings. You'll need to rename this to the new subject name, or a legitimate subject name in your subject tree.
Hope this helps.
www.sqlrepl.com- Marked as answer by Palak Kadakia Monday, January 23, 2012 2:42 AM
Monday, December 5, 2011 11:29 PM
All replies
-
One of the steps that is required to set up the customer portal is to configure your subject tree and set the "Site Setting" for "case/subject" to that subject. The error you are seeing indicates that the code could not locate the subject name for the default value of that site setting. This is covered in the installation guide.
Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com- Proposed as answer by Maria Joaquin Thursday, October 20, 2011 10:31 PM
Monday, October 17, 2011 11:07 PMModerator -
Hi Shan,
We are having this same issue but we can´t find to what subject we must set the value for the "case/subject" site setting. We can´t find any reference to this in the installation guide.
The only diference is that we are working over our own crm organization and not with the sample data.
This is our only showstopper to buy your adx portals.
Saturday, November 12, 2011 3:40 AM -
The case entity requires a subject in CRM. What subject you use is irrelevent, just that you have to have a subject. Most organizations configure their subject heirarchy to make sense to their support system. The portal needs to know which subject to use when it inserts a new case, so it reads the value from a site setting. If you have an english install of CRM and you have not configured your subject tree, you could simply put "default subject" into the site setting.
Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com- Marked as answer by Palak Kadakia Monday, January 23, 2012 2:42 AM
Saturday, November 12, 2011 3:27 PMModerator -
I just had this happen to me.
The error is likely the result of a user changing the name of a subject that is also set as your site setting case/subject. You can find the site setting case/subject in Content Management -> Site Settings. You'll need to rename this to the new subject name, or a legitimate subject name in your subject tree.
Hope this helps.
www.sqlrepl.com- Marked as answer by Palak Kadakia Monday, January 23, 2012 2:42 AM
Monday, December 5, 2011 11:29 PM