CA Service Management

  • 1.  onSubmit Valildade Custom Field

    Posted Oct 08, 2018 09:36 AM

    Hey guys!

     

    I need to develop something to validate the fill of a custom field to prevent analysts from inserting spaces and points.

     

    I have created some customized text fields to insert some information of the incident, however, the analysts are putting spaces or ellipses to circumvent the mandatory  field's.

     

    I researched some topics in the community but unfortunately I could not find anything relevant to this need.

     

    Did any of you ever have to do something like that?

     

    I figured that using some javascript function would be possible to do something like this, such as an onSubmit event.

     

    Many thanks, guys!



  • 2.  Re: onSubmit Valildade Custom Field

    Broadcom Employee
    Posted Oct 08, 2018 10:26 AM

    take a look at

    SPEL to change the field value before saving the ticket 

    that you can write js script for this purpose



  • 3.  Re: onSubmit Valildade Custom Field
    Best Answer

    Posted Oct 08, 2018 02:26 PM

    Hi,

    if you have preSaveTrigger() function defined on form, it will be checked on submit, example:

    function preSaveTrigger() {
        if (someCondition) {
            return true; // everything is fine
        }
        return false; // submit will be prevented
    }

    Regards.



  • 4.  Re: onSubmit Valildade Custom Field

    Broadcom Employee
    Posted Oct 08, 2018 03:15 PM

    this should wok as well...one minor suggestion...use preSaveTrigger2() instead of preSaveTrigger()



  • 5.  Re: onSubmit Valildade Custom Field

    Posted Oct 08, 2018 04:24 PM

    Hi Chi, why do you suggest that?



  • 6.  Re: onSubmit Valildade Custom Field

    Broadcom Employee
    Posted Oct 08, 2018 04:28 PM

    Lindsay, just to avoid anything that could get to the way of out of box preSaveTrigger(). It is always a good idea to have your own trigger. Thanks _Chi



  • 7.  Re: onSubmit Valildade Custom Field

    Posted Oct 09, 2018 02:17 PM

    Hey guys,


    Many thanks for all the suggestions!

     

    It was extremely important each one of them!

     

    I'll use something like this and a possible data partition too!

     

    Thanks again to everyone!