Where is SNC.AssessmentCreation() ?

adityavishnu
Giga Expert

I am trying to understand the below piece of code especially the first line in which an object is created. I understand it is creating a new assessment i don't understand below points.

1. Where is the AssessmentCreation()(i believe script include) is written? In my Script Include of my instance(Eureka) it is not available and how do i view the code written in AssessmentCreation() ?

2. What is the objective of SNC. ?

3. Can an admin in ServiceNow edit AssessmentCreation() ?

(new SNC.AssessmentCreation()).conditionTrigger(current, 'f4faa78a2b53e100e653224e59da157c');

  if(flag){

  var gropen = new GlideRecord('asmt_assessment_instance');

  gropen.addEncodedQuery(surveys);

  gropen.query();

  while(gropen.next()){

  gropen.state = 'ready';

  gropen.update();

  }

  }

t

16 REPLIES 16

Hi Wesley,



How you get the data really depends on how the data is structured. If there is a 1:1 relationship through a reference field, you can simply dot-walk to that value



I noted in picture 1 that you have built a reference qualifier. That's a "filter" so when someone requests a new name in that field, only certain values (like only active users) can be chosen.



In picture 2 you have a default value which is nice if you are creating a new record, but doesn't do much for existing tables.



Can you help me understand what your requirement is (not how you want to solve it) and a quick layout of how your data is related? That might help.


Hi Chuck,



We are also trying to generate an assessment dynamically using the SNC.Assessmentcreation() in our scoped application.



However it is not working properly if we use it in scoped application. If we use the same code in global scope then it is generating assessment dynamically.



We have the on-demand assessment type.



The issue is we are aiming to publish the application to store and the changes from the global scope will not get moved along with the app.



Could you please give your insights on the same?


Can you expand on the details around this statement?



However it is not working properly if we use it in scoped application.



I'm not clear what is not working... Any errors?


Hi Chuck,



"However it is not working properly if we use it in scoped application"



To elaborate more the above statement, when we use the said method in scoped application the assessment's are not generating automatically.



Below code is not working if we are in scoped application.



new SNC.AssessmentCreation().createAssessments('c88c31a3dbee8340070cd001cf9619a5','',current.employee_name);


Hi Shital,



I don't have deep enough understanding of the class you are trying to use and therefore don't have any additional information to offer on this thread. If nobody else joins in, I recommend reaching out to customer support. I'll be interested to hear what they have to say.


HI Service Portal - ServiceNow


Contact Support | ServiceNow