How to create custom script include function for ui action

Research
Tera Guru

Hi all

 

Has any idea on how to create a custom Script include  function and call with UI action
which is there for [incident (create work order)]
similar I want to create a custom script include function (not copying of OOTB script include) for request table. 
Ui action (Custom create work order)

 

Below is the script Please guide me to add as custom script include which should work like incident create work order.  
 
Please guide me with script 
    createWorkOrderFromRequest: function(request) {
        var workOrder = this._retrieveWorkOrder(true, request, true);
       
        // work order already exists and redirection is already handled
        if (workOrder == null)
            return;
       
        // complete the work order definition and creation
        workOrder.location = request.location;// here you can add the fields that you'd like to map from the Request to the Work order
        workOrder.caller = request.requested_for;
        workOrder.description = request.description;
        workOrder.insert();
       
        // redirect to new work order
        this._redirectToNewWorkOrder(workOrder, request);
        return workOrder;
    },



Thanks

0 REPLIES 0