CA Service Management

  • 1.  Auto-suggest/type-ahead using different field

    Posted May 17, 2017 09:06 AM

    We have a customer who would like to be able to use auto-suggest/type-ahead on the staff number (which they have in the 'alias' field) when searching for requesters/affected users for incidents and changes.

    Someone suggested that this could be done by defining a different factory with 'alias' as the common name, but I've tried it without success.

    As far as I can tell I'm following this approach properly. Has anyone tried anything like this before?



  • 2.  Re: Auto-suggest/type-ahead using different field

    Broadcom Employee
    Posted May 17, 2017 09:48 AM

    Mike, I think this should work...did you use something like

    autofill=yes factory=xxxxx

    ?

    Thanks

    Chi



  • 3.  Re: Auto-suggest/type-ahead using different field

    Posted May 17, 2017 10:02 AM

    Yes. I had the following in cnt_alias.maj:

     

    OBJECT cnt {

    ATTRIBUTES ca_contact {

    alias_last_name

    DERIVED( alias " " last_name);

    alias_combo_name

    DERIVED( alias " " last_name isnull( ", " first_name " " middle_name) );

    };

      

    FACTORY cnt_alias {

    DOMSET cst_list "alias,combo_name,phone_number,contact_num,organization,location" "" DYNAMIC;

    STANDARD_LISTS {

    SORT_BY "alias,combo_name,phone_number,contact_num,organization=organization.name,location=location.name";

    WHERE "delete_flag = 0";

    MLIST OFF ;

    RLIST OFF ;

    };

    REL_ATTR id ;

    COMMON_NAME alias;

    FUNCTION_GROUP "contact" ;

    };

    };

     

    I also had this in detail_in.htmpl:

     

    <PDM_MACRO name=dtlLookup hdr="Requester Service No" attr="requested_by" factory="cnt_alias" evt="onChange=\\\"backfill_cnt_event()\\\"">

     

    It should probably be backfill_cnt_event2() with 14.1.



  • 4.  Re: Auto-suggest/type-ahead using different field

    Posted May 17, 2017 10:02 AM

    Just realised I didn't have autofill=yes, will try it.



  • 5.  Re: Auto-suggest/type-ahead using different field

    Posted May 17, 2017 10:10 AM

    What actually happens with this version of detail_in.htmpl is this:

    I type in the first few characters of a valid staff number (aka service number) and nothing happens. I then click on the search link and it has my first few characters plus a percentage sign in the 'last name' and 'first name' boxes, and 'middle_name like '***%'' in additional search arguments.



  • 6.  Re: Auto-suggest/type-ahead using different field

    Broadcom Employee
    Posted May 17, 2017 12:02 PM

    Mike, I tried to do it and saw that it is more than modify this locally. With backfill_cnt_event() or backfill_cnt_event2(), certainly it can't work as those functions are hard coded to use the out of box schema. I tried not to use this backfill function, I saw it try to have first_name, last_name and middle name all filled with what_ever_typed_in%, but not the

    alias field, though I have modified list_cnt.htmpl/list_cnt_alias.htmpl file to have "alias" field there. As such, auto suggestion didn't work. I can't figure out yet why it worked like this. Maybe someone else in the community tried use

    a non out of box cnt factory before and shed some light here? Thanks _Chi



  • 7.  Re: Auto-suggest/type-ahead using different field

    Broadcom Employee
    Posted May 17, 2017 04:47 PM

    Mike, with

    COMMON_NAME alias;

    I was able to make the auto suggestion work by using the alias value to auto fill the requested_by.

    However, there is a price to pay...I would need to modify the cnt schema from

    requested_by SREL cnt { UI_INFO "AUDITLOG" ; } ;

    to

    requested_by SREL cnt_alias { UI_INFO "AUDITLOG" ; } ;

    in the original cm.maj file under sdm-install-dir\bopcfg\majic

    and the affected end user will not be filled automatically. My statement is simple:

    <PDM_MACRO name=dtlLookup hdr="Requester" attr="requested_by" autofill=yes>

    If this is fine with you, you may give this a try to see if it works for you too.

    Thanks

    Chi



  • 8.  Re: Auto-suggest/type-ahead using different field

    Posted May 18, 2017 04:28 AM

    Thanks for that. I will try it in a development environment and see how it works.