CA Service Management

  • 1.  pdm_macro where clause not updating results on lookup upon tab

    Posted Mar 27, 2015 02:20 PM

    Hello,

     

      I have a quick question on a customized form. Here is a bit of background:

     

    In Service Desk "on Tab" on a Lookup field is not working as expected when we use where clause.

    We have a field called zProduct which is a SREL to NR object.

    We would like the lookup field to show the list of CIs with family.zSupportCat=1 and is_ci=0

     

    if we type some text and then it tab, the results show ) records. when we hit search button again, it gives results. In other words, first search on TAB is not rendering results.

     

    below is line of code from cmdb_detail.htmpl

     

    <PDM_MACRO name=dtlLookup hdr="Product" attr="zProduct" extraURL="ADDITIONAL_WHERE=family.zSupportCat=1 and is_ci=0">

     

    Any help on why it is not loading the info when bringing the form would be greatly appreciated.

     

    Thanks in advance!

     

    Luis



  • 2.  Re: pdm_macro where clause not updating results on lookup upon tab

    Broadcom Employee
    Posted Mar 27, 2015 02:44 PM

    Luis, did you try

    extraURL="ADDITIONAL_WHERE='family.zSupportCat=1 and is_ci=0'"

    ? thanks _Chi



  • 3.  Re: pdm_macro where clause not updating results on lookup upon tab

    Posted Apr 02, 2015 12:03 PM

    Chi,

     

       Adding the additional quotations causes the following error upon clicking on the lookup:

     

    AHD03053:Bad where clause: Parse error at : "( 'family.zSupportCat=1 and is_ci=0' ) AND ( delete_flag = 0 )" (syntax error) ('family.zSupportCat=1 and is_ci=0')


    Any idea why?


    Thanks!


    Luis



  • 4.  Re: pdm_macro where clause not updating results on lookup upon tab

    Posted Apr 03, 2015 03:44 AM

    hi,

    this is an actual problem,

    in our environment we are resolving it via new factories.

     

    but I don't know how we can to restrict dot separated attributes via factory.

     

    typical factory restriction looks like:

    ////////////////////////////////////////////////////////////////////////

    // Factory:   nr

    // Filename: its_nr.maj

    ////////////////////////////////////////////////////////////////////////

    OBJECT nr {

      FACTORY its_nr{

      RESTRICT "class = 300172" { class = 300172} ;

      STANDARD_LISTS {

      SORT_BY "name" ;

      MLIST OFF ;

      RLIST OFF ;

      };

      REL_ATTR id;

      COMMON_NAME name;

      FUNCTION_GROUP "inventory";

      };

    };

     

    usage example:

    <!-- NEW searchFilter -->

    <PDM_MACRO name=sfLookup hdr="its" attr=category.z_nr.name factory=its_nr>

    <!-- OLD searchFileter -->

    <PDM_MACRO name=sfLookup hdr="its" attr=category.z_nr.name extraURL="ADDITIONAL_WHERE=class = 2857">

     

    you may try to create new list_* form, with fake factory name (for example "list_zSupportCat.htmpl"), where will be your decided list of NR's,

    you can call it from maro with next code:

    <PDM_MACRO name=dtlLookup hdr="Product" attr="zProduct" factory=zSupportCat>

    but this is volume work.

     

    regards,

    cdtj.



  • 5.  Re: pdm_macro where clause not updating results on lookup upon tab

    Posted Apr 03, 2015 08:52 PM

    Hi,

    When you go to Menu-->Search-->Configuration Ítems, you press "Show Filter" and you put the "family.zSupportCat=1 and is_ci=0" filter into "Additional Search Arguments" field, this work fine?



  • 6.  Re: pdm_macro where clause not updating results on lookup upon tab

    Posted Apr 07, 2015 10:49 AM

    Hi,

     

      It does work OK when you o a search, it even works if you do the lookup the 2nd time. it's just that when tabing it does not seem to pre cache the where clause.

     

    Thanks!



  • 7.  Re: pdm_macro where clause not updating results on lookup upon tab

    Posted Apr 07, 2015 02:25 PM

    Hi, I am reviewing your information. You have a relationship between nr.zProduct SREL nr.id

     

    You need to associate a zProduct to CI how attribute

     

    You want that the list nr show you nr (family.zSupportCat=1 and is_ci=0) only

     

    step 1

     

    Add line into cmdb_detail.htmpl

     

    <PDM_MACRO name=dtlLookup hdr="xxxxx" attr=zProduct extraURL="ADDITIONAL_WHERE=(family.zSupportCat=1 and is_ci=0)+KEEP.ejemplo=1">

     

    step 2

    Add line into list_nr.htmpl (into filter sección)

     

    <PDM_IF "$args.KEEP.ejemplo" == "1">

    searchFilterTextDisabled("******",".family.zSupportCat",10,1,1,"EQ");

    </PDM_IF>