Bring data from Embedded List to Client Script

Srinivas Balusu
Kilo Guru

Hi,

Is there a way to bring the data from embedded list to Client script for data validations?

16 REPLIES 16

Hi Paul,



Unfortunately NO. But I did a workaround for this by creating an After Insert Business Rule on Parent table


Hi Srini,



Did you try creating onCellEdit() type client script set on the table which is embedded in your form and the field which you wish to validate?



This article explains what parameters it can return for data validation:


Client Scripts - ServiceNow Wiki



I could set up an onCellEdit() client script on my embedded table, and it got triggered from the form when I edited the embedded list cell, and had access to its parameter values:


find_real_file.png


But, My data validation has to happen parent and child table columns simultaneously. Something like this: Parent.Start_date > EmbeddList.start_date



Any suggestions?


var parent= new GlideRecord("your parent table name here");


        parent.query();


var embedded_list = new GlideRecord("your embedded list table name here");


        embedded_list.addQuery('current.start_date' , '>' , parent.start_date);


        embedded_list.query();



  while(embedded_list.next()) {



//write script for fields you need


I have also the same requirement. i need get the data from embedded list and match with another table. if it's same then give some pop up on form and if it's not same then form will submitted successfully.



mallen_nspi ctomasi rfedoruk tltoulson



Just want to know how to get the data from embedded list.



Please suggest.



Thanks,


Harshvardhan