CA Service Management

 View Only
  • 1.  Make conditional read-only field

    Posted Mar 09, 2016 08:33 PM

    Hi Guys,


    Can anyone help me understand how I make one text field read only if another field on the same form has been populated.


    e.g.  Field A when populated with a value makes field B read only.

  • 2.  Re: Make conditional read-only field
    Best Answer

    Posted Mar 10, 2016 03:08 AM


    here is some examples based on algorithm:

    • attach event to object A;
    • switch readOnly state for object B;

    Re: Customizing dtlDate macro

    New field required if 'yes' is selected - Customizations / Modifications - ServiceDeskUsers




  • 3.  Re: Make conditional read-only field

    Posted Mar 16, 2016 06:39 PM

    With the links help managed to get it to work....


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

    <PDM_MACRO name=dtlLookup hdr="Configuration Item" attr=affected_resource evt="onChange=\\\"assetChanged()\\\" onFocus=\\\"assetChanged()\\\"" make_required=yes>


    <PDM_MACRO name=dtlReadonly hdr="Configuration Item" attr=affected_resource>


  • 4.  Re: Make conditional read-only field

    Broadcom Employee
    Posted Jul 06, 2017 08:22 AM

    Hi cdtj


    I am having a similar situation but here I want to make drop down and date field read only/editable on selection of particular status.


    I tried the solution from the links mentioned above by you which is working perfectly for text field but it is not working for date and drop down field.

    Is there any thing different that we need to do for drop down/date field?




  • 5.  Re: Make conditional read-only field

    Posted Jul 10, 2017 04:31 AM


    to make date field readonly you also need to disable click event/URL in field's header and write a method to make it clickable again. This can be done using JS/JQuery but I haven't any useful examples.


    For these purposes in our env we are simply switching mandatory state:

    detailMakeReq("sched_start_date", false); // to make "sched_start_date" Required
    detailMakeReq("sched_start_date", true); // to make "sched_start_date" not Required

    And users in most situations aren't fill unrequired empty fields for no reason