CA Service Management

Expand all | Collapse all

How to check edit form on detail_alg form

Jump to Best Answer
  • 1.  How to check edit form on detail_alg form

    Posted 11-27-2017 03:38 PM

    I did a javascript code for set the default value internal flag as true, but i have a problem. When i'm going to edit the comment the flag is always true, because i can not check if is edit comment or new comment.
    I tryed use _dtl.edit check, but don't works.

     

    The zvalorPadrao() method is call in body onload

     

    <body class="detailro" onload="loadActions();call_def_last_alg();zvalorPadrao()" onunload="unloadActions()">

     

     

    //Show for user that field is checked
    function zvalorPadrao(){
         var elementExist =  document.getElementsByName("CBX.internal")[0];
            // Here I must check if It's edit form too
         if(elementExist){
         document.getElementsByName("CBX.internal")[0].checked = true;
         }
    }


    function zCbxVerificaValor(internalChecked){
         var isChecked = internalChecked;
              if(isChecked && document.forms["main_form"].elements["SET.alg.internal"]){
                   document.forms["main_form"].elements["CBX.internal"].value=1;
                   document.forms["main_form"].elements["SET.alg.internal"].value =1;
              }else{
                   document.forms["main_form"].elements["SET.alg.internal"].value =0;
                   document.forms["main_form"].elements["CBX.internal"].value=0;
              }
    }

     

    Any suggestion?

     

    Regards.



  • 2.  Re: How to check edit form on detail_alg form

    Posted 11-27-2017 04:42 PM

    you may want to see if you can use "$args.id" == 0  to check if it is new comment or an existing one...if true, new comment;else existing one. Combined with _dtl.edit, we should be able to distinguish the two cases.



  • 3.  Re: How to check edit form on detail_alg form
    Best Answer

    Posted 11-28-2017 08:47 AM

    Hi Chi_Chen.

    I used your ideia and I finded the solution.

    I used "$args.call_req_id" == 0 for my goal, that works good.

    Thanks.