"AHD05237:An internal error with surveys occurred" and "AHD03055:Data partition Create restriction on Survey" in multi-tenanted environment

Document ID : KB000056729
Last Modified Date : 14/02/2018
Show Technical Document Details

In a multi-tenanted environment, when Submit is clicked by a (tenanted) Employee on a survey form that is associated with an Incident (i.e. using URL received in an email, for example: http://SDMSERVER/CAisd/pdmweb.exe? OP=DO_SURVEY+SID=0+SVY_ID=400001+CNT_ID=8F8FC50C4410364188C772C820909C95+CNTXT_PERSID=cr:400030), the error message, "AHD05237:An internal error with surveys occurred", is written on the form and the following messages are written to the stdlog:

01/13 15:26:58.14 SDMSERVER      web:local            4824 ERROR freeaccess.spl       12064 Error checking in survey! INVALID AHD03055:Data partition Create restriction on Survey @|domsrvr|bMSAAA|1421145509|1


01/13 15:26:58.15 SDMSERVER      web:local            4824 SIGNIFICANT session.c             7512 Session
cnt:8F8FC50C4410364188C772C820909C95-309681631:0x570a8a0 ended with error 3; id(8F8FC50C4410364188C772C820909C95); session count 1

Note that there are no data partition constraints defined on the Survey table (in fact, the Survey table is not a managed table). 

The Survey that is being submitted belongs to the Service Provider tenant.

The solution is to use a Survey that is Public (shared). 

Some cases in which the solution has been used:

Case 1:

The Incident Area and Affected End User of the Incident would both also belong to a subtenant of the service provider tenant and the activities used to send out the Survey belongs to the Service Provider.  We do not send out the surveys based on category/area, but based on activities.  This is because we wants to send out a survey on a successful solution and another on non-successful solution. As all 3 of our clients should receive the same survey, we place it in the service provider tenant. 

Solution: Use public survey not a service provider tenanted survey.

Case 2:

To reproduce the Error symptoms, follow these steps:

1. Install the multi-tenancy option. Create the Service Provider Tenant and put a tick in the Subtenants Allowed checkbox.  For this example, the Service Provider tenant is named "tenantsp", with Subtenants allowed = Yes, Service Provider=Yes.
2. Create a tenant named tenant1 such that tenant 1 is a subtenant (depth=1) of tenantsp.
3. Note that in the previous step, when tenant1 was configured as a subtenant of tenantsp, the corresponding tenant groups were automatically created: tenant1_relatedtenants, tenant1_subtenants, tenant1_supertenants, tenantsp_relatedtenants, tenantsp_subtenants, tenantsp_supertenants.
4. Create a new Contact named employeetenant1 with Contact Type set to Employee and with Access Type set to Employee.  Note: The out-of-the-box Employee access type has 1 role named Employee which is associated with the Data Partition named Employee; The Tenant Authorization for the out-of-the-box Employee role is defined with: Update Public? No, Tenant Access=Contact's Supertenant Group, Tenant Write Access=Contact's Tenant; The out-of-the-box Employee data partition does not have any constraint defined on the Survey table - in fact, the Survey table is not a Data Partition Controlled Table.
5. Create a new Survey Template named survey1tenantsp which has the Tenant set to tenantsp.  For example, give it 1 simple question (when created within the Questions tab of the Survey Detail form, the Tenant of the question gets set automatically to the same as tenant as the survey template, which, in this example, is tenantsp).  In the Survey Question template, create 2 simple answers via the Answers tab, Survey Answer List - the tenant gets automatically set to tenantsp.
6. Create a new Area under Requests/Incidents/Problems named ApplicationsTenantsp, with the Tenant set to tenantsp and with the survey set to survey1tenantsp.
7. Create a new Incident, for example Incident #121.  The Tenant of the incident is set to tenant1; the Requester is set to employeetenant1; the Affected End User is set to employeetenant1; the Incident Area is set to ApplicationsTenantsp; the initial status of the Incident was Open; it was later changed to Closed and the activity log shows that the survey was sent (the stdlog did not really send it but the URL is in the stdlog and is used later to access and submit the survey).
8. The Activity Notification of the out of the box Close activity notification has Send Survey set to Yes.
9. Close the Incident and a notification should be sent to the Affected End User that contains the URL for taking the Survey. 
10. Copy the URL into a new web browser tab.  Take the survey. Click on Submit to submit the survey.

Solution: When creating a new survey in step#5, do not set the Tenant; when you save the survey template, the Tenant is automatically set to "public (shared)".