Make field mandatory when user clicks on related list button

Aruna Sree Yela
Tera Guru

Hi,

 

In incident form I have 2 fields "Product" and "Vendor" 

 

If "Vendor" is ABC and User clicks on 'New' button on the related list of Incident tasks, then the field "Product" should become mandatory.

 

Can anyone help me on this

 

Thanks in advance:)

2 REPLIES 2

Kris Moncada
Tera Guru

Hi @Aruna Sree Yela ,

 

I believe you can do this with an onload client script that makes a GlideAjax call. 

 

On my instance, I opened an incident, then click on New on the Child Incident related list. The resulting url has lots of fun info when decoded.

KrisMoncada_0-1718409380298.png

I would then use the information (hightlighted) to do a GlideAjax call that returns an JSON object of parent incident's current values; of which would then drive all kinds of fun logic like:

  • make a field mandatory if Parent Incident has a certain value,
  • etc.

Hope this helps.  When I get free moment, i'll see about developing some code to test the idea out.

 

Hi @Kris Moncada ,

 

Do you have any reference code for the same, that would be helpful for me

 

Thanks