2 Replies Latest reply on Sep 3, 2013 9:06 AM by Aaron Carey

    Prevent saving a ticket if field value is equal to something

      Share This:

      Hello,

      I'm trying to create specific functionality in SC 11.6. System is configured to create tickets from emails. There is a required (both for customers and agents) drop down field called Organization Unit. Because customers are lazy and I can't be sure that they will send emails with correct Organization Unit in the email body I've decided to put some default value for this field.

      The problem is that I want to disallow agents submitting tickets (via WWW) if they do not change the default value of the Organization Unit. Is it possible to achieve something like that?

       

      Regards

        • 1. Re: Prevent saving a ticket if field value is equal to something
          Johan Gouverneur

          If you don't think that your users will input the field or put in the wrong data, then don't make it mandatory for them.  Take the default value out of the field. This way the engineers will be forced to input the "Organization Unit". Your engineers will just need to make sure that the correct data is in here (which they already need to do as I understand).

           

          This can be achieved with a procedural fix instead of a programmatic one.

          • 2. Re: Prevent saving a ticket if field value is equal to something
            Aaron Carey

            Yes, you can use JavaScript to set the "Organization Unit" field to "No Choice" when an agent CREATES a ticket:

             

            <script language=javascript>

             

            doc = document.regform;

             

            if (!(doc.TEMPLATE)) //if this is a template we do not want to run the script

                {

                      switch(cMode)

                        {

                            case 'CREATE':

                                if(doc.CUSTM)

                                    {

                                        //Do something for Customers Only

                                    }

                                else

                                    {

                                        //Do something for Agents Only

                                          doc.Organizational__bUnit.selectedIndex = 0;

                                    }

                                break;

             

                            case 'EDIT':

                                if(doc.CUSTM)

                                    {

                                        //Do something for Customers Only

                                    }

                                else

                                    {

                                        //Do something for Agents Only

                                    }

                                break;

                        }

                }

            </script>

             

            Thanks,

            Aaron Carey