HI All

basha shaik
Tera Contributor

HI All,

i have two tables table A and table B.

 

The value on table B(Like updated date field) should be on table A.

 

 

Thanks

 

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @basha shaik 

 

Please provide some more details please. are these table are extended from any or like a parent child?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Vaibhav_Nikam
Tera Guru

Hi @basha shaik ,

You can use the After Business Rule on table A for insert/update which will update value in table B Like


(function executeRule(current, previous /*null when async*/) {
	var grTab = new GlideRecord('problem');                          //consider it for table B
	grTab.addEncodedQuery('field='+current.sys_id);            // query for particular record
	grTab.query();
	if(grTab.next())
	{
		grTab.sys_updated_on = current.sys_updated_on;    //update value
		grTab.autoSysFields(false);                                          // false for sys_auto_fields.
	}

	// Add your code here

})(current, previous);

 


If my response finds helpful, please indicate its helpfulness by selecting Accept as Solution and Helpful.

Thanks,

Vaibhav Nikam

Ankur Bawiskar
Tera Patron
Tera Patron

@basha shaik 

please share what's your business requirement here'

why have you used 2 tables and what's the purpose for those and relationship between them?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader