CA Service Management

  • 1.  How to set custom text in alg.description field

    Posted Jul 20, 2018 11:23 AM

    I want to set custom text while updating Request/Incident tickets (Activities-->Update Status).

    Requirement is when analyst will change status from Work in progress to Resolved. Description field will auto populate text e.g. "Enter Resolution details".

    Please advise.

    Thanks

    Sagar



  • 2.  Re: How to set custom text in alg.description field

    Posted Jul 21, 2018 06:10 AM

    Hi,

    performing this customization requires JavaScript basics:

    - add event handler before your dropdown macro to make it look like:

    detailSetEventHandler("onchange='zChangeDescription(this);'");
    <PDM_MACRO name=dtlDropdown ... >

    - then create js function to handle status change:

    function zChangeDescription(obj) {
         var zDescr = document.main_form.elements["SET.alg.description"];
         if (typeof(obj.value) == "undefined") {
              alert('Cant handle dropdown');
         } else if (typeof(zDescr.value) == "undefined") {
              alert('Cant fetch description area');
         } else {
              if (obj.value == "RE") {
                   zDescr.value = "Enter Resolution details";
              } else if (obj.value == "HOLD") {
                   zDescr.value = "Enter Hold reason";
              } else {
                   // etc
              }
         }
    }

    Please note that followed code provided as example and wasn't tested.

     

    Regards.



  • 3.  Re: How to set custom text in alg.description field

    Posted Jul 23, 2018 10:00 AM

    Thank you very much, I am testing and will provide you an update.



  • 4.  Re: How to set custom text in alg.description field
    Best Answer

    Posted Jul 25, 2018 11:31 AM

    I have tested this, detailSetEventHandler is not working.

    ***************************************************************************************

    <PDM_IF "$args.type" == "I">
    <PDM_MACRO name=dtlDropdown hdr="New Status" attr=status default="!default_trans_sym!" evt="onBlur=\\\"detailSyncEditForms(this)\\\" onChange=\\\"make_desc_required(this)\\\"" factory=crs_in initial="!default_trans_code!">
    <PDM_ELIF "$args.type" == "P">
    <PDM_MACRO name=dtlDropdown hdr="New Status" attr=status default="!default_trans_sym!" evt="onBlur=\\\"detailSyncEditForms(this)\\\" onChange=\\\"make_desc_required(this)\\\"" factory=crs_pr initial="!default_trans_code!">
    <PDM_ELSE>
    //detailSetEventHandler("onChange='zChgDes(this);'");  -----> This is not working
    <PDM_MACRO name=dtlDropdown hdr="New SR Status" attr=status default="!default_trans_sym!" evt="onBlur=\\\"detailSyncEditForms(this);\\\" onChange=\\\"zChgDes(this)\\\"" factory=crs_cr initial="!default_trans_code!">
    </PDM_IF>

    *****************************************************************************************

    I have replaced onChange inside <PDM_MACRO> and its working.

    Please advise.

     

    Thanks

    Sagar



  • 5.  Re: How to set custom text in alg.description field

    Posted Jul 25, 2018 03:41 PM

    Glad you found working solution!

    detailSetEventHandler working in SDM12.7, if you have newer version you can check source codes (detail_form.js) to check compatability with your env.



  • 6.  Re: How to set custom text in alg.description field

    Posted Jul 26, 2018 06:58 AM

    Thanks it is working fine. This is Service Desk 17.