Home Analyst Portal

Custom task on CI form

Alex_MarshAlex_Marsh Premier Partner Advanced IT Monkey ✭✭✭
Is it possible to add a custom task to a configuration item form, such as a purchase order? I can't see where to specify the form task panel. trying 'Purchase order' or 'PurchaseOrder' didn't seem to work

Answers

  • Alex_MarshAlex_Marsh Premier Partner Advanced IT Monkey ✭✭✭
    Anyone?
  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭
    edited November 2016
    Hi,

    if you take a look at wimain.js you find the following lines ...


    //add custom tasks
        var tasks = app.custom.formTasks.get(pageForm.type);
        if (_.isArray(tasks)) {
            $.each(tasks, function (i, task) {
                pageForm.taskTemplate.tasks.push({ Task: "custom", Type: pageForm.type, Label: task.label, Access: true, Configs: { func: task.func } })
            });
        }

    these lines are not present in the ammain.js (at least until Version 6.02) - you can add those lines to the ammain.js and then you are able to put custom Tasks on the asset Management form like:

    app.custom.formTasks.add('HardwareAsset', "create ...", function (formObj, viewModel) {
       your_function();
    });


    but please note - this change is not permanent - if you update the Portal to a newer Version - the update has to be done once again due to the files are overwritten.

    maybe this helps you


  • Alex_MarshAlex_Marsh Premier Partner Advanced IT Monkey ✭✭✭
    Certainly a pointer in the right direction but I was hoping there would be a way to put this into custom.js. I basically need to launch a webpage from a purchase order which links to the purchase order report for that item. Easy to do from the console, not so from the portal
  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭
    I have modified the ammain.js with those few lines - all other customization for the task is done in custom.js  - as for all the other work item based tasks. These  lines will just enable that custom tasks can be put on the asset Management form
  • Alex_MarshAlex_Marsh Premier Partner Advanced IT Monkey ✭✭✭
    Thanks roland, finally got around to looking at this again. Looks like no changes to the latest version but it's odd as the customtask kb states you can add custom tasks to asset management...
Sign In or Register to comment.