Use this code in your ui action:



var t=current.getValue('field_name');


var gr=new GlideRecord('table_name');


gr.addQuery('field_name!=""');


gr.query();


while(gr.next())


  {


  if(gr.field_name==t)


  {


  gs.addInfoMessage('There is a record with same invoice number');


  //current.setAbortAction(true);   //use this if you don't want to update the record or use current.update()


  break;


  }


  else


  current.update();


}



let me know if this helps.



Thanks


Priyanka


View solution in original post

Hi Malaisamy,



is it working?


malaisamy1
Kilo Contributor

Hi Priyanka,



It works perfectly... Thanks for the support


Can you please mark the answer correct and close this thread so that others find it useful.



Thanks


Priyanka.


malaisamy1
Kilo Contributor

Hi Priyanka,



I am not getting the 'correct answer button'. SO that i have marked this as useful.



Let me know if you want me to do anything