How to call Business rule in Ui action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2019 03:04 AM
Hi,
How to fire Business Rule in UI action to create child tables record. After clicking the Ui action The state changes properly but I am not able to fire the BR to Create child tables records.
Once the records get created The another ui action should be visible.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2019 03:21 AM
Hi Ash,
Can you paste your code here to get things clear.
Below threads have same requirement, have a look on below threads also.
UI Action to Create Record in Another Table.
Create a new UI Action to create a new record
Mark Correct/Helpful, based on impact of response.
Regards,
Devyani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2019 03:22 AM
Hi Ash,
I hope this help:
https://community.servicenow.com/community?id=community_question&sys_id=6367023adb2867c0fece0b55ca961921
Please mark the answer as correct/helpful if it suffice your query.
Thanks.
Soumita.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2019 03:40 AM
Hi Devyani,
I had just write the code to change the state after clicking the Ui action. I am not able to fire BR to create child tales record.
function onClick(){
if(g_form.getValue('state') != 'discuss')
{
g_form.setValue('state',"discuss");
//alert('state changes to discuss');
}
gsftSubmit(null, g_form.getFormElement(), 'createDiscussion');
}
if (typeof window == 'undefined')
serverDiscussion();
function serverDiscussion(){
current.state = 'discuss';
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2019 03:53 AM
code to create the discussion record without firing the Business Rule
function onClick(){
if(g_form.getValue('state') != 'add')
{
g_form.setValue('state',"add");
//alert('state changes to add');
}
gsftSubmit(null, g_form.getFormElement(), 'createadd');
}
if (typeof window == 'undefined')
serverAdd();
function serverAdd(){
current.state = 'add';
current.update();
var disc = new GlideRecord('x_256866_outlier_r_add');
disc.evaluation=current.number;
disc.state ='new';
disc.property=current.property;
disc.insert();
disc.update();
}
evaluation field not populated with the current record number.