CA Service Management

  • 1.  Is it possible to hide pdm_macro fields and retain their functionality?

    Posted Apr 27, 2015 11:45 AM

    Hi,

     

    We have resolution code as a required field upon changing the Incident status to closed and resolved.  On our employee forms we have code that will bring this field to the request_status_transition.htmpl and request_status_change.htmpl forms.  On the employee interface it will automatically select the resolution code Resolved By Customer.  When an Analyst selects a resolution code it will instead make that visible to the employee but give them the option to change it to Resolved By Customer.  Due to this behavior, I was wondering if anyone is aware of how to make the field hidden?

     

    Here is the pdm_macro I'm working with.  I have tired adding hidden="yes" and I also followed a few generic javascript/css examples of how to hide fields, none of them worked here.  If it is possible to hide this field but still have it fill in the resolution code in the background that would be ideal.  If anyone has ideas/suggestions I would appreciate it!

     

     

    <PDM_MACRO name=dtlDropdown hdr="Resolution Code" attr="resolution_code" colspan="1" default="Resolved By Customer" make_required="yes" size="20" whereclause="sym = 'Resolved By Customer'">



  • 2.  Re: Is it possible to hide pdm_macro fields and retain their functionality?

    Posted Apr 27, 2015 02:11 PM

    Hi,

    actually values are passed by hidden inputs, you can add one of them without PDM_MACRO.

    ex; document.write('<input type="HIDDEN" name="SET.resolution_code" value="<YOUR_VALUE_HERE>"')

    You can get actual values via PDM_LIST macro.

    Regards,

    cdtj.



  • 3.  Re: Is it possible to hide pdm_macro fields and retain their functionality?

    Posted Apr 27, 2015 06:19 PM

    Thank you cdtj!

     

    This works, but it will overwrite the resolution code set by the Analyst.  Do you have any idea how to make it conditional and only set the resolution code if one is not provided?  I tried the follow pdm_if code but it didn't work.

     

    <PDM_IF "$args.resolution_code == "">

    <input type="hidden" name="SET.resolution_code" value="400007">

    </PDM_IF>



  • 4.  Re: Is it possible to hide pdm_macro fields and retain their functionality?

    Posted Apr 28, 2015 02:31 AM

    Hi,

    this sounds strange your conditions seems to be correct.

    You can try to debug to find correct value, for example:

    <script>
    <PDM_IF "$args.resolution_code == "">
    console.log("$args.resolution_code" + " is null");
    <PDM_ELSE>
    console.log("$args.resolution_code" + " is not null");
    </PDM_IF>
    </script>
    

    or you can use "alert"s instead.



  • 5.  Re: Is it possible to hide pdm_macro fields and retain their functionality?
    Best Answer

    Posted Apr 28, 2015 02:39 AM

    You’re missing a trailing double quote after “$args.resolution_code.

     

    Should be


    <PDM_IF "$args.resolution_code" == "">

     

    Regards,

    James



  • 6.  Re: Is it possible to hide pdm_macro fields and retain their functionality?

    Posted Apr 28, 2015 10:07 AM

    Thank you so much cdtj and James!  This works perfectly now.