logo

NJP

After Business Rule [ServiceNow]

Import · Jul 08, 2019 · video

hello everyone so in this video we are going to learn and discuss about after vision through after witness ruled executes after form is submitted by user and after record updated or inserted in database generally we use after witness rule for updating the related or child records for an example we have here as update work nodes on child incident been some work nodes are added to parent incident so we also have a practice design here I will demonstrate it step-by-step you can practice it in your personal developer instance so the problem statement is same update work notes on child incident when some work nodes are added to parent incident so I will create a after business rule for this so let me just maybe get to business rule I will create a new you have update work notes on child so I will put a tape it here as incident and check advanced and select when as after and I will put update I will not put insert here because when the incident will be submitted then only the child will be added to that incident now in advance we have to write the same code as written here you can type it I will copy from my notepad so here we have the port I will explain it so this code will run and it will query the incident table where the incidents have parent F current incident once it will get the reports in query it will copy the work notes of current incident to the child incident and update the child incident so we have a related list on incident if you scroll down for the child incident so if you don't have it in your instance you can go to configure related list and you can add this related list incident I have been parent to your incident form to see the child incident for a particular incident let's just save this form now we will test it so I will navigate to incident list I will open one of the incident let's see if there are any child incident there are not let's just add few child's here so I will put a filter here a state is new and run this filter and I got your incident let me add 58 59 say if this now you have two child's off incident 7.0 - there are 59 and 52 I will open doors in new tab 459 there are the work notes currently no worth not and here are 459 so protest it let's just add few worth nodes to parent incident this is test we will save this now these work node should get up a two child incidents so we have 50 88 if you see this is test work notes get copied and if you see here the verb notes are also get copied you can write it some more good code here like from which incident it is copied so you can write it like worked note up north coffee from air ant incident and you can put the into a number here current dot number so it will give more information when someone looking at the work note so let's just again put some work notes here this is step two for our notes now let's just save this to save now we will check it on child incident so now we have work note copied from parent incident I an see this live this and here are the work notes so now it is giving more information from where it is copied like that thank you for watching the video please like subscribe and share the channel I will be back with some more video on business rule thank you

View original source

https://www.youtube.com/watch?v=c1wERhMMtrg