Notifications

9 views

Description

In case there are many survey instances associated with a survey, submitting a survey from Service Portal will take longer than expected.

Steps to Reproduce

Make sure there are many survey instances (we've seen the issue with 800.000 records) associated with a survey

1. Go to service portal and open the survey
2. Fill out the survey and submit.

See it may take too long to submit (we've experienced around 10 seconds)

Workaround

The issue is caused by the query below, in the method saveMultipleCheckboxesAndRanking() in the script include “AssessmentSubmitProcessor”, 


var qst = new GlideRecord("asmt_assessment_instance_question");
qst.addQuery('metric', metric);
qst.addQuery('source_id', source_id);
qst.query();

The query is too broad and there are around 90k records meet the condition. The solution is to make it narrow by adding another condition as below, 
var qst = new GlideRecord("asmt_assessment_instance_question");
qst.addQuery('metric', metric);
qst.addQuery('source_id', source_id);
qst.addQuery(‘instance’, instance); // add this line to narrow down the query
qst.query();


Related Problem: PRB1353755

Seen In

There is no data to report.

Intended Fix Version

Orlando

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-07-31 07:39:52
Published:2019-07-31