Home General Discussion

Show/Hide Custom task in incident menu based on support group/s.

Sharon_SpearsSharon_Spears Customer Advanced IT Monkey ✭✭✭
edited February 2021 in General Discussion

I have a custom task:

/* START: Change Status to Pending Quotation */


app.custom.formTasks.add('Incident', "Pending: Quotation", function (formObj, viewModel) { 

$.when(kendo.ui.ExtYesNoDialog.show({ title: "Change Status", message: "Are you sure you want to change the status to Pending:Quotation?" })).done(function (response) { if (response.button === "yes") { 

/* set new status */ 

viewModel.Status.set("Name", "Pending:Quotation"); 

viewModel.Status.set("Id", "52effae3-f104-9bf2-2d7d-868e170f8b6a"); } });

return; });

/* END: Change Status to Pending Quotation */


I use a HideCustomTAaskEndUser.js file to hide from everybody but all Analyst. Which works well.

app.custom.formTasks.add('Incident', null, function (formObj, viewModel) { formObj.boundReady(function () { if (!session.user.Analyst) { $( ".taskmenu li:contains('Pending: Quotation')" ).hide() } }); });

I'd like to be able to only show some task for some support group/s.

Is there a edit for (!session.user.Analyst) to specify a support group?

Thanks in advance.

Answers

  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭

    Hi @Sharon_Spears

    Hope you are well.

    I have had a little play around with this and couldn't get it as elegant as I'd like because IE does not support a lot of modern methods but this should work still and will be compatible across all browsers. I have already filled in your custom code into my code so all you should need to do is copy and paste this across and replace what you have currently. You will no longer need a custom task to hide the task for non analysts as it will now only show if they are a member of the specified groups which you can change on line 11 of the code.

    Let me know if this helps.

    Shane.

  • Sharon_SpearsSharon_Spears Customer Advanced IT Monkey ✭✭✭

    thanks @Shane_White

    I will give it a go as soon as I can. Thank you for getting back so quick.

Sign In or Register to comment.