Skip to content

Instantly share code, notes, and snippets.

@cmcdevitt
Created March 5, 2015 23:08
Show Gist options
  • Select an option

  • Save cmcdevitt/fd379664422ec5bef6b6 to your computer and use it in GitHub Desktop.

Select an option

Save cmcdevitt/fd379664422ec5bef6b6 to your computer and use it in GitHub Desktop.
Record Producer Survey Data Test
//pick_asmt, new_exp_date, new_due_date, new_sys_crt_date, new_state -- Variable Set
//asmt_assessment_instance --> expiration_date
//asmt_assessment_instance --> due_date
//asmt_assessment_instance --> number
//asmt_assessment_instance --> sys_created_on
//asmt_assessment_instance --> state
//gs.log("CM***: " + producer.pick_asmt + " " + producer.new_exp_date);
gr = new GlideRecord("asmt_assessment_instance");
gr.get(producer.pick_asmt);
if(producer.new_exp_date){
//Not sure what this date is used for!
gr.expiration_date = producer.new_exp_date;
}
if(producer.new_due_date){
//Used to display color a survey un Self-service: Red past due, Green future due
gr.due_date = producer.new_due_date;
}
if(producer.new_sys_crt_date){
//Used for ->Trigger Condition: Repeat Interval
gr.sys_created_on = producer.new_sys_crt_date;
}
if(producer.new_state){
gr.state = producer.new_state;
}
gr.update();
//https://community.servicenow.com/people/MB/blog/2011/04/25/2479
//Use this line to prevent a Record Producer from creating a new record...
current.setAbortAction(true);
//http://www.jasonbutz.info/blog/2014/09/24/servicenow-record-producers.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment