Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

dot walking on incident form using ui action

komalkp
Tera Contributor
 var category = g_form.getValue('category');
 var attachmentValue = g_form.getValue('u_file_attachment_1');
 var assignmentGroup = g_form.getValue('assignment_group.parent');
 
 
 alert("assignmentGroup:" +assignmentGroup );
 

 

 if ( assignmentGroup==='xyz'  && attachmentValue === '' && category === 'abc') {
     g_form.setMandatory('u_file_attachment_1', true);
     g_form.showFieldMsg('u_file_attachment_1', 'Resolution confirmation Evidence is required when resolving an incident', 'error', true);
 } else {
     g_form.setMandatory('u_file_attachment_1', false);
     g_form.hideFieldMsg('u_file_attachment_1');
}
when i go for the dot walking in the assignment group variable I am not getting any value in that variable if i remove parent (field backend name) I am getting assignment group value please any one can help me in this.
1 ACCEPTED SOLUTION

Harish KM
Kilo Patron

Hi @komalkp you cannot dotwalk in get Value method. You can make your UI action as both server and client callable and then it should.work

View solution in original post

3 REPLIES 3

Harish KM
Kilo Patron

Hi @komalkp you cannot dotwalk in get Value method. You can make your UI action as both server and client callable and then it should.work

need to use script include?

Hi @komalkp you don't need to use script include refer below example how to make both client and server within ui action

https://docs.servicenow.com/bundle/vancouver-api-reference/page/script/useful-scripts/reference/usin...