before adding additional comments, time worked should be mandatory

shri5
Mega Guru

Hi,

 

There is a requirement from one of the client that, on incident form when we add additional comments or work notes in notes section of incident form, to track time, time worked field should be filled.

 

Currently when we write something in additional comments, and click the post button, comments gets added in activity.

 

Does anyone have got similar requirement or have any idea how we can deal with such a scenario.

 

Please do let me know your views.

 

 

Thanks,

Shrikant.

2 REPLIES 2

Namrata Ghorpad
Mega Sage
Mega Sage

Hi Shrikant,

Write onChange client script on additional comments field and try below script to make time worked field mandatory.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }

   //Type appropriate comment here, and begin script below
	if(newValue!=oldValue)
		{
			g_form.setMandatory('time_worked',true);
		}
   
}

 

Please mark my answer as helpful/correct if it helps you.

Regards,

Namrata

 

shri5
Mega Guru

Hi @Namrata Ghorpad 

Thanks for your reply, I have already tried writing this script, but it doesn't give any prompt or error message after we click post button.

Thanks,

Shrikant.