CA Service Management

 View Only
  • 1.  Search Filter boolean results

    Posted Jan 14, 2020 12:11 PM
    ​I have a custom field in the search filter that I need to add as column on the list screen.  But I can't seem to figure out how to convert the binary result to Yes/No.  The field is setup as var passval = searchFilterDropdown("Remotable","z_quest_used","","Yes","1","No","0");  When I added the field to lscol:  <PDM_MACRO name=lsCol hdr="Remotable?" attr=z_quest_used startrow="no"> and the checkbox is checked it displays as 1 but I need it to show up as a YES.  When the box isn't checked it should return no, but the default is NULL so it just shows up as blank.  


    ------------------------------
    Service Desk Administraor
    GTS
    ------------------------------


  • 2.  RE: Search Filter boolean results

    Broadcom Employee
    Posted Jan 15, 2020 03:54 AM

    Hi Susan,

    Please add "common_name_option=yes" and let us know your results:

    <PDM_MACRO name=lsCol hdr="Remotable?" attr=z_quest_used startrow="no" common_name_option=yes>

    Regards,

    Karen



    ------------------------------
    Broadcom
    ------------------------------



  • 3.  RE: Search Filter boolean results
    Best Answer

    Posted Jan 15, 2020 09:18 PM
    Edited by SUSAN SUNKLE-THORPE Jan 16, 2020 10:54 AM
    If z_quest_used is set as an SREL then the common_name_option will work. If it is just defined as an integer attribute, you can do the following in the list form:

    function showYesNo(value)
    {
      if (value == 1) {
        rs.data("Yes");
      } else {
        rs.data("No");
      }
    }
    
    
    <PDM_MACRO name=lsColhdr="Remotable?" attr z_quest_used fmtfunc=showYesNo>
    ​


    ------------------------------
    Lindsay Estabrooks
    Principal Consultant
    IT-EDU Consultants
    ------------------------------



  • 4.  RE: Search Filter boolean results

    Posted Jan 16, 2020 10:55 AM
    That did it.  Thank you for your help!​

    ------------------------------
    Service Desk Administraor
    GTS
    ------------------------------