CA Service Management

Expand all | Collapse all

Service Catalog Attachment Required

Jump to Best Answer
  • 1.  Service Catalog Attachment Required

    Posted 04-12-2018 12:46 PM

    It is possible to configure service catalog to allow attachemnts required configuring it via form script instead of using the default option in service option group?



  • 2.  Re: Service Catalog Attachment Required
    Best Answer

    Posted 04-12-2018 01:44 PM

    Hi,

     

    Yes it's possible.  We use the following JavaScript to check the number of attachments associated with the request.  This script sets a variable to the number next to the Attachments link.

    var attachments = document.getElementsByName("attachments-1")[0].innerText.match(/\(([^)]+)\)/)[1];
    if(attachments == 0){
      alert("Please add an attachment then press Submit again.");
      return false;
    } else {
      console.log(attachments + ' attachments found');
      return true;
    }

     

    You can use this in an onSubmit function to stop the user from submitting the form if they haven't added an attachment.



  • 3.  Re: Service Catalog Attachment Required

    Posted 04-13-2018 04:08 PM

    Hi this solution works, but only for service catalog.

    In my case I´m accessign catalog through USS and in USS there is no link and count for attachments in page.

    If someone has another solution I will thank



  • 4.  Re: Service Catalog Attachment Required

    Posted 03-08-2019 04:48 PM

    Lograste solucionar este tema?



  • 5.  Re: Service Catalog Attachment Required

    Posted 10-03-2018 02:34 PM

    Any other ideas to make a solution like this work acessing catalog via USS interface, because in USS we don´t have the attachments count like in catalog page.



  • 6.  Re: Service Catalog Attachment Required

    Posted 04-16-2018 01:57 AM

    Good Morning Paulo.

    Perhaps the following can then help you further for the USS environment?

    Service Catalog provides a method to create your own custom JavaScript functions in a central location.
    Which is USM_Home\filestore\custom\explorer\scripts\custom_form_lib.js file.
    So they can be called from multiple forms and from multiple places.
    This is great and very useful for reducing maintenance for common functions.

    As in an example:

    Custom js file:
    function mytest() {
    alert(2);
    }

    Form: onLoad = mytest()

    Thanks and kind regards, Louis.