Home Analyst Portal

Filter By Analyst on Activity Implementer

Michael_CostelloMichael_Costello Customer IT Monkey ✭
I'm trying to set manual activities to filter the activity implementer by analysts only.  I tried adding the line below to the activities section in the ServiceRequest.js form, but when I do SR's stop loading and just spin until I hit the back page button.

{ DataType: "UserPicker", PropertyDisplayName: "ActivityImplementer", PropertyName: "AssignedWorkItem", FilterByAnalyst: true },

Does anyone know the proper syntax?

Best Answers

  • Michael_CostelloMichael_Costello Customer IT Monkey ✭
    Accepted Answer

    @Jerry_Veldhuis


    // Add the FilterByAnalyst setting to the Activity Implementer dropdown control

    app.custom.formTasks.add('ServiceRequest', null, function (formObj, viewModel) {

     pageForm.boundReady(function () {

     $(document).on("ajaxStop","",setFilterByAnalyst);

     });

    });

    app.custom.formTasks.add('ChangeRequest', null, function (formObj, viewModel) {

     pageForm.boundReady(function () { 

     $(document).on("ajaxStop","",setFilterByAnalyst);

     });

    });

    function setFilterByAnalyst () {

     var userPicker = $("input[data-control-bind='AssignedWorkItem'][data-control-itemtype='ManualActivity']"); 

     if (userPicker.length > 0) { 

     userPicker.each(function(index,picker) {

      $(picker).data("kendoAutoComplete").dataSource.options.transport.read.data.filterByAnalyst = true;

     });

     $(document).off("ajaxStop","",setFilterByAnalyst);

     }

    };

Answers

  • Lauren_BoxallLauren_Boxall Customer IT Monkey ✭
    I don't have the answer but am interested in this as well - do you get a solution?
  • Michael_CostelloMichael_Costello Customer IT Monkey ✭
    No, I haven't figured it out yet
  • Michael_CostelloMichael_Costello Customer IT Monkey ✭
    That works great! Thank you so much!
  • Jerry_VeldhuisJerry_Veldhuis Customer Advanced IT Monkey ✭✭✭

    @john_doyle - can you repost this solution ? The code in the accepted answer is just a comment line.

  • Michael_CostelloMichael_Costello Customer IT Monkey ✭
    Accepted Answer

    @Jerry_Veldhuis


    // Add the FilterByAnalyst setting to the Activity Implementer dropdown control

    app.custom.formTasks.add('ServiceRequest', null, function (formObj, viewModel) {

     pageForm.boundReady(function () {

     $(document).on("ajaxStop","",setFilterByAnalyst);

     });

    });

    app.custom.formTasks.add('ChangeRequest', null, function (formObj, viewModel) {

     pageForm.boundReady(function () { 

     $(document).on("ajaxStop","",setFilterByAnalyst);

     });

    });

    function setFilterByAnalyst () {

     var userPicker = $("input[data-control-bind='AssignedWorkItem'][data-control-itemtype='ManualActivity']"); 

     if (userPicker.length > 0) { 

     userPicker.each(function(index,picker) {

      $(picker).data("kendoAutoComplete").dataSource.options.transport.read.data.filterByAnalyst = true;

     });

     $(document).off("ajaxStop","",setFilterByAnalyst);

     }

    };

Sign In or Register to comment.