CA Service Management

  • 1.  How to change the field in the dtlhier?

    Posted Dec 08, 2015 11:57 AM

    I am creating a multi language Service Desk, and the customer wants to show for the employee the categories in Spanish for those who speak spanish and portuguese for the ones who speak portuguese.

    I've created a field called zss_sym_es to store the spanish translation. How do I show this information in the hier for the category field instead of the ss_sym field?



  • 2.  Re: How to change the field in the dtlhier?

    Posted Dec 08, 2015 06:27 PM

    Hi,

     

    There isn't an easy way to support multiple languages in SDM...  One approach to support this at the db layer for lookup fields is to have separate roles for Spanish/Portuguese employees.  Then you could have a different list_pcat_in_ss.htmpl file for each role.  In this file change the following line.

     

    <PDM_MACRO name=lsCol hdr="Symbol" attr=ss_sym exportFmt=ShowLink link=yes>

    to

    <PDM_MACRO name=lsCol hdr="Symbol" attr=zss_sym_es exportFmt=ShowLink link=yes>

     

    I haven't done much testing, but I did change the value from ss_sym to sym and it worked, so I'm assuming it will work with your custom string as well.



  • 3.  Re: How to change the field in the dtlhier?

    Posted Dec 08, 2015 06:39 PM

    Upon further review the method I posted doesn't work..  I'm digging in a bit further to see if this is possible.



  • 4.  Re: How to change the field in the dtlhier?

    Posted Dec 09, 2015 05:01 AM

    hi,

    I think this can be done in this way:

    - define your Translation as new factory (virtual or via maj file), example:

    <PDM_MACRO name=dtlHier hdr="Category" attr=category autofill=no evt="onchange=\\\"change_category_func('cr',null,'pcat_cr');\\\"" factory=pcat_cr_es make_required="yes" size=80>

    - copy original hierload_pcat_cr and hiersel_pcat_cr files and make them "factory named" : hiersel_pcat_cr_es (and hierload too).

    - check that new dtlHier works with newly created files (add alert into new files or something like that);

    - here is the triky part, you need to replace sym with your own attr in HierInsert function:

    cai_main.HierInsert(

                   '<PDM_FMT ESC_STYLE=JS>$list.HIER_level_name</PDM_FMT>',

                   '<PDM_FMT ESC_STYLE=JS>$list.COMMON_NAME</PDM_FMT>',

    ...

    replace COMMON_NAME with zss_sym_es, or you can create new factory via MAJ file and define COMMON_NAME as zss_sym_es within the factory.

    Remember to make same customization in hiersel_* file.

     

    Regards,

    cdtj



  • 5.  Re: How to change the field in the dtlhier?

    Posted Dec 09, 2015 06:06 AM

    Hi,

     

    I did all that and it worked in part.

     

    So what I did so far:

     

    I created a new factory call pcat_cr_ss_es

     

    FACTORY pcat_cr_ss_es {

      RESTRICT "ss_include = 1 AND ss_sym IS NOT NULL" { ss_include = 1} ;

     

      STANDARD_LISTS {

         SORT_BY "zss_sym_es" ;

         WHERE "delete_flag = 0" ;

         MLIST OFF ;

         RLIST OFF ;

      };

     

      REL_ATTR persistent_id ;

      COMMON_NAME zss_sym_es ;

      FUNCTION_GROUP "reference" ;

        };

     

    I changed the detail_cr in employee directory:

     

    <PDM_MACRO name=dtlHier hdr="Área de solicitud" attr="category" autofill=yes common_name="zss_sym_es" factory=pcat_cr_ss_es size=30>

     

    I created new files in the default directory:

     

     

    Created in the xml e tagged directory as well.

     

    I created in the employee directory (xml and tagged):

     

     

    The tree in the employee screen is showing ok:

     

     

    But when loading in the category field, it changes to the ss_sym field

     

     

    And the popup for choosing the category keeps appearing.



  • 6.  Re: How to change the field in the dtlhier?

    Posted Dec 09, 2015 06:42 AM

    have you tried to use dtlHier without common_name attr?



  • 7.  Re: How to change the field in the dtlhier?

    Posted Dec 09, 2015 07:50 AM

    Something happens in the dyn_properties file that changes the value.

     

     

    Juliana Mendo

    Tel: +55 11 2766-1519

    Cel: +55 11 95652-5814



  • 8.  Re: How to change the field in the dtlhier?
    Best Answer

    Posted Dec 09, 2015 09:05 AM

    I managed to make it work.

     

    I had to duplicate the filed dyn_properties.htmpl and rename to dyn_properties_es.htmpl

    Changed the line:

    var cat_err_msg = '<PDM_FMT ESC_STYLE=C PAD=NO>${AlertMsg:}</PDM_FMT>';

      if ( cat_err_msg == "") {

      sink.update_ss_cat_field('<PDM_FMT ESC_STYLE=C PAD=NO>$args.category.zss_sym_es</PDM_FMT>',

      '<PDM_FMT ESC_STYLE=C PAD=NO>$args.category</PDM_FMT>');

      }

     

    I had to duplicate the file load_properties.htmpl and rename to load_properties_es.htmpl (did the same to the load_properties in the tagged and xml directory).

    changed the include to dyn_properties_es.htmpl

    <PDM_INCLUDE FILE="dyn_properties_es.htmpl">

     

    I had to change some scripts files:

     

    change_cat.js

    change the line where call the filed load_properties.htmpl to load_properties_es.htmpl

     

    if ( typeof _dtl == "object" ) {

    url += "+HTMPL=load_properties_es.htmpl";

    if ( is_hier )

     

     

    cst_cat.js

    change the line where call the filed load_properties.htmpl to load_properties_es.htmpl

     

    document.getElementById("tblProperties").style.display = "none";

    var url = cfgCgi +

    "?SID=" + this.SID +

    "+FID=" + this.FID +

    "+OP=UPDATE" +

    "+change_category=1" +

    "+IS_NOT_SAVE=1" +

    "+FACTORY=" + this.factory +

    elementNameValue +

    "+HTMPL=load_properties_es.htmpl" +

    "+SELF_SERVICE=1" +

    "+SERVICE_CST=" + cstID +

    "+IS_HIER=1";

    ahdframeset.workframe.document.location.replace(url);



  • 9.  Re: How to change the field in the dtlhier?

    Posted Dec 09, 2015 11:44 AM

    This is very cool, this is a customization some of my end users have asked for.  At least from the employee role perspective it doesn't seem that challenging to implement.  Adding this customization to all the analyst fields would take more work.