CA Service Management

 View Only
  • 1.  attachment constrain

    Posted Nov 13, 2017 01:31 AM

    hello guys;


    i want a constrain to force a user to attach at least 3 files before saving the request.

  • 2.  Re: attachment constrain

    Posted Nov 13, 2017 02:11 AM


    have you seen my comment from your previous thread? Attachment Counter 

    Also I have found one more similar thread with alternative resolution (without spel customization): How to make Attach Document field mandatory. 



  • 3.  Re: attachment constrain

    Posted Nov 13, 2017 02:20 AM

    Thnx cdtj for your response, regarding the alternativ way, how can i use the pre save trigger, appreciate your patience and your indetail info plzz

  • 4.  Re: attachment constrain
    Best Answer

    Posted Nov 13, 2017 02:34 AM

    preSaveTrigger triggers when user click "Save" button, if function return true statement - ticket will be saved, otherwise will be interrupted without any error so you need to specify error message by yourself. Best way to try it, run in your test env, simply specify followed code somewhere in <head> area in detail_cr.htmpl for example:

    // put me in <head> area
    function preSaveTrigger() {
         var zSomeFlag = false;     // switch me for test purposes, don't forget to reset webcache (cmd: pdm_webcache -H)
         if (zSomeFlag) {
              alert("Saving because zSomeFlag is true");
              return true;
         } else {
              alert("Can't save because zSomeFlag is false");
              return false;

  • 5.  Re: attachment constrain

    Posted Nov 13, 2017 04:00 AM

    Thnx cdtj

    i will give it a try at my lab and well give you my feedback