CA Service Management

  • 1.  Service Catalog 17.1 nodup_dup:function

    Posted Dec 05, 2018 10:38 AM

    I am trying to prevent two fields on a form from having the same value by using the nodup function. My form is complete and functioning except I need to have different values in the Technical Contact (tech_contact = _id value on form) and the Verifier Contact (verifier - _id value on form) fields. I have tried several different java script functions, ca_fdGetTextFieldValue, ca_fdFetchSelectData, and so on and I have also tried it using the submitting:function(){

     

    Thanks

     

    nodup_dup:function(){
      var re = ca_fdGetSelectedOptions('form_id_value','tech_contact');
      var ve = ca_fdGetSelectedOptions('form_id_value','verifier');
      var re_st = re.toString();
      var ve_st = ve.toString();
      if(re_st == ve_st){
        alert("The technical contact and the change verifier cannot be the same person.\r\nPlease correct before submitting.");
     {ca_fdUnselectAllOptions('form_id_value','verifier', '');}
     {ca_fdUnselectAllOptions('form_id_value','tech_contact', '');}
        }
      },



  • 2.  Re: Service Catalog 17.1 nodup_dup:function

    Posted Dec 05, 2018 03:34 PM

    Hi,

     

    Give this a try. Here's what i changed.

    1. Changed ca_fdGetSelectedOptions to ca_fdGetSelectedOptionValues

    2. Removed the third empty parameter from ca_fdUnselectAllOptions as that function only requires two parameters (form id and field id)

    3. Removed extra curly brackets from ca_fdUnselectAllOptions 

    4. Don't forget to replace form_id_value with the id of your form

     

    nodup_dup:function(){
      var re = ca_fdGetSelectedOptionValues('form_id_value','tech_contact');
      var ve = ca_fdGetSelectedOptionValues('form_id_value','verifier');
      if(re == ve){
        alert("The technical contact and the change verifier cannot be the same person.\r\nPlease correct before submitting.");
        ca_fdUnselectAllOptions('form_id_value','verifier');
        ca_fdUnselectAllOptions('form_id_value','tech_contact');
      }
    },


  • 3.  Re: Service Catalog 17.1 nodup_dup:function

    Broadcom Employee
    Posted Dec 10, 2018 07:34 AM

    Good Afternoon Terry.

     

    Are you okay with the given response/example?

     

    Thanks in advance and kind regards, Louis.



  • 4.  Re: Service Catalog 17.1 nodup_dup:function

    Posted Dec 10, 2018 08:39 AM
      |   view attached

    Hi Louis

     

    The given example did not work, the odd thing is I have the code working on a different form (slightly different) the only difference is the form name and the report plugin.

     

    I actually changed the report plugin on the form where the code is not working and that didn’t work.

     

    Thanks

     

    Terry