CA Service Management

 How to customize field behavior in the detail_cr form

John Carmino's profile image
John Carmino posted 11-25-2021 07:33 AM

Hi guys,

I need help with this case:

I created a custom attribute on the cr object for the user to justify when there is a change in impact or urgency, but the field should only appear in the detail_cr form when the user changes the impact or urgency value.
could someone help me with this?

henning1815's profile image

in detail_cr form at runtime you can only do it with JS/JQuery

For example:

function showcustomfield() {
	 jQuery("[pdmqa='yourfield']").show(); //Value
         jQuery("label:contains('yourfieldheader')").closest('th').show(); //Show Header

Attach the event. onBlur means it fires when you leave the Field or you can try OnChange. You will find it in all forms.

<PDM_MACRO name=dtlTextbox hdr="Urgency" attr=urgency evt="onBlur=\\\"showcustomfield()\\\"">

<PDM_MACRO name=dtlTextbox hdr="Impact" attr=impact evt="onBlur=\\\"showcustomfield()\\\"">


		 document.main_form.elements["SET.yourfield"].value = "";​

John Carmino's profile image
John Carmino
Hi @Henning1815,

Thanks for your help with my case,

I tried to do it the way you suggested, but I still can't get it to work.
I took another attribute, just to test (template_name), and the field appears on the form even if there is no change in the impact or urgency fields.

Can you help with this?