i have a requirement for CMDB form

MK21
Tera Contributor

Hi all , 

 

I have a requirement in cmdb form , we have fields inn CMDB computer form 

MK21_3-1690386585236.png

 

MK21_4-1690386628025.png

 

based on the install status 

MK21_2-1690385735383.png

when install status is installed ,issued date is mandatory and clear the returned date

 

when the install status is pending repair or in stock issued date is empty and Return date will be mandatory 

How to achieve thsi 

14 REPLIES 14

pratiksha5
Mega Sage

You can create policy . 

 

https://www.youtube.com/watch?v=baTVAEYaHlQ

 

 

MK21
Tera Contributor

I THINK NEED CLIENT SCRIPT 

Naveen N
Tera Expert

Please find the solution

If its correct please mark the answer as correct

 

NaveenN_0-1690390687170.png

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
	if(g_form.getValue('u_install') == 'installed'){
		g_form.setMandatory('u_issue_date',true);
		g_form.clearValue('u_return_date',true);
		g_form.setMandatory('u_return_date',false);
	}
	
	if(g_form.getValue('u_install') == 'pending repair'){
		g_form.setMandatory('u_issue_date',false);
		g_form.setMandatory('u_return_date',true);
		g_form.clearValue('u_issue_date',true);
	}
   //Type appropriate comment here, and begin script below
   
}

Thanks in Advance

MK21
Tera Contributor

Not working 

 

MK21_2-1690392946926.png