Making the worknotes mandatory when the priority changes

robinchadwick
Mega Expert

In the Incident Management application, how do I make the worknotes mandatory when the priority changes.

1 ACCEPTED SOLUTION

Swapnil Bhakar1
Mega Guru

Hi Robin,



Follow below steps to make work notes field mandatory on change of priority.



Select Table name: Your table name (e.g. Incident)


Type: onChange


Field Name:   Priority



Script:



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue === '') {


          return;


    }




    //Clearing the value of Owner field on change of Owner Group


      if(newValue != oldValue)


    g_form.setMandatory('work_notes',true);


}



Hope this will help you.



Regards,


Swapnil



PS: Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

12 REPLIES 12

Sorry, you will have to write an onChange client script for this. You


cannot do it with a UI policy, since you want this to trigger on change of


priority field



On Saturday, August 20, 2016, robinchadwick <


Abhinay Erra
Giga Sage

Write an onChange client script on priority filed incident table and put this script in there



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


  if (isLoading || newValue === '') {


  return;


  }


  g_form.setMandatory('work_notes',true);


}


Is there a way to do it without writing a script?


Swapnil Bhakar1
Mega Guru

Hi Robin,



Follow below steps to make work notes field mandatory on change of priority.



Select Table name: Your table name (e.g. Incident)


Type: onChange


Field Name:   Priority



Script:



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue === '') {


          return;


    }




    //Clearing the value of Owner field on change of Owner Group


      if(newValue != oldValue)


    g_form.setMandatory('work_notes',true);


}



Hope this will help you.



Regards,


Swapnil



PS: Hit like, Helpful or Correct depending on the impact of the response


Is there a way to do it without writing a script?