please share business rules scenarios

sasikiran9900
Kilo Explorer

please share definition of business rules and scenarios of after,before, async and display for interview  level.

18 REPLIES 18

Create "Problem" button on incident form.

Go with the script.

var prb_num = '';
var gr = new GlideRecord('problem');
    gr.initialize();
gr.category = current.category;
gr.short_description = current.short_description;
gr.description = current.description;
// gr.impact = current.impact;
// gr.urgency= current.urgency;
if(current.priority == 3){
    gr.setValue('priority', '2');
}
gr.assigned_to = current.assigned_to;
gr.cmdb_ci = current.cmdb_ci;
gr.setValue('parent', current.sys_id);
gr.setValue('u_caller_id', current.caller_id);
prb_num = gr.insert();


var inc = new GlideRecord('incident');
if(inc.get(current.sys_id.toString())){
    inc.problem_id = prb_num;
    inc.update();
    gs.addInfoMessage('The new problem has been created for you with number ' +gr.number+ " "+current.number);
}

action.redirectURL(current);

Scenario 1 : Add work in progress button on incident, so that if you click on that button, you have to set state to Work in progress.

Scenario 2: Button to "Set Priority 1", on click of the button impact and urgency should be set to 1 so that the priority will change to 1.

    Code for this button:-

function setPriority1()
{
    alert('This button will not save the record');
    g_form.setValue('impact',1);
    g_form.setValue('urgency',1);
}

You have to use client scripts to do theese things and you have to check the client check box to true. Onclick you have to mention the function name ,for ex:- setPriority1().

Helpful!!

Helpful!!

Helpful!!