auto check checkbox when location type is india in change form

mishrarakes
Tera Contributor

The question is:

  1. Please create a check box field on Change module form with name PharmaQA.
  2. It should auto checked when any user select location type is India on change form, other than India it wouldn’t auto select.

I have created the field with the name PharmaQA. but is not autochecking when location location type is india.

I tried to achieve this using Ui Policy and scripting still its not working can any one help pls...

I am also attaching the screen shot what I have done. 

1 ACCEPTED SOLUTION

Rohit  Singh
Mega Sage

Hi @mishrarakes ,

 

You can create a OnChange Client script on filed " Location"

 

If(NewValue == "India")

{

g_form.SetValue("u_PharmaQA",true);    // Check and Update you field Name what it's there.

}

 

If my response helped, please mark it helpful and accept the solution so that it benefits future readers.

 

Regards,
Rohit

View solution in original post

5 REPLIES 5

Rohit  Singh
Mega Sage

Hi @mishrarakes ,

 

You can create a OnChange Client script on filed " Location"

 

If(NewValue == "India")

{

g_form.SetValue("u_PharmaQA",true);    // Check and Update you field Name what it's there.

}

 

If my response helped, please mark it helpful and accept the solution so that it benefits future readers.

 

Regards,
Rohit

Hi @mishrarakes

 

Please check my solution above.

 

If my response helped, please mark it helpful and accept the solution so that it benefits future readers.

 

Regards,

Rohit 

Hi @mishrarakes

 

Did you tried the solution provided above. 

 

If my response helped, please mark it helpful and accept the solution so that it benefits future readers.

 

Regards,

Rohit

 

Vishal Salvi1
Tera Contributor

Hi @mishrarakes ,

 

You can create a OnChange Client script on filed " Location"

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    if (newValue == 'fca681f5931631003b4bb095e57ffb8d') { //sys_id of india location
        g_form.setValue('u_pharmaqa', true);
    }
 
}
 

If my response helped, please mark it helpful and accept the solution.

Regards,
Vishal