How to autopopulate the created scenario plan name in the scenario plan field after submission of RP

Priyapatnayak
Tera Contributor

I can able to create a scenario plan after submission of record producer form. But in the task record I am unable to see the autopopulation of scenario plan field with the scenario plan name. I have used script include + written code in record producer directly, I am posting my code here. can someone please help me out to find the exact mistake in my code. 

 

script include:

 

var scenario_plan_creation = Class.create();
scenario_plan_creation.prototype = {
    initialize: function() {
    },

    create_Scenario_Plan: function()
    {
        // Create a new scenario plan record in the custom table
        var scenarioPlanGR = new GlideRecord('sn_wsd_spcmgmt_scenario_plan');
        scenarioPlanGR.initialize();
        scenarioPlanGR.name = producer.request_name;
        scenarioPlanGR.group_by = producer.department_name;
        scenarioPlanGR.location = producer.building_name;
        scenarioPlanGR.insert();
        var scenarioPlan_name = current.name;
        gs.info("priyanka" +scenarioPlan_name);
        return scenarioPlanGR.sys_id;
    },

};
 
Record producer code:
 
new global.scenario_plan_creation().create_Scenario_Plan(producer);
current.scenario_plan = scenarioPlanGR;
0 REPLIES 0