CA Service Management

 View Only
  • 1.  custom code to show specific workflow statuses and not all.

    Posted Aug 07, 2019 05:58 AM
    Edited by Aamir Khan Aug 08, 2019 05:34 AM

    Dear Team

    On Some workflow tasks type, we have more than 3 statuses which is HOLD and SKIP, And few team should not see these 2 statuses so we have created webform and customized detail_wf.htmpl file with following code. The code is working perfect on Chrome Browser but on Internet Explorer its not working. Showing all statuses.

    Please can anyone help me how this code should also work on IE browser also? as our bank policy is to use IE only.

    <PDM_IF "$prop.form_name_3" == "edit">
    <script>

    var requiredStatuses = ["REJ","PEND","APP"];
    setTimeout(function(){

    var statusSelection = document.getElementsByName("SET.status")[0]; 
      for(var i=0; i < statusSelection.length; i++)
    { if(requiredStatuses.includes(statusSelection.options[i].value.toUpperCase()))
    {
    var y=0;
    }else{
    statusSelection.remove(i);
    i=i-1;       

      }},1000);
    </script>
    </PDM_IF>

    #ca_sdm_17.1
    #ca-sdm
    #customization


  • 2.  RE: custom code to show specific workflow statuses and not all.

    Posted Aug 09, 2019 07:48 AM
    .includes is not supported by IE.

    Use (.indexOf > -1) instead.


  • 3.  RE: custom code to show specific workflow statuses and not all.

    Posted Aug 09, 2019 07:57 AM
    Dear Pier

    Thanks for the input. Pls can you correct me with the following modified code is now ok as you advised? 

    <PDM_IF "$prop.form_name_3" == "edit">
    <script>

    var requiredStatuses = ["REJ","PEND","APP"];
    setTimeout(function(){

    var statusSelection = document.getElementsByName("SET.status")[0]; 
      for(var i=0; i < statusSelection.length; i++)
    { if(requiredStatuses.indexOf > -1(statusSelection.options[i].value.toUpperCase()))
    {
    var y=0;
    }else{
    statusSelection.remove(i);
    i=i-1;       

      }},1000);
    </script>
    </PDM_IF>


  • 4.  RE: custom code to show specific workflow statuses and not all.
    Best Answer

    Posted Aug 09, 2019 08:09 AM
    if(requiredStatuses.indexOf(statusSelection.options[i].value.toUpperCase()) >-1)


  • 5.  RE: custom code to show specific workflow statuses and not all.

    Posted Aug 19, 2019 07:42 AM
    Many Thanks Pier