Error message showing multiple times on form

Community Alums
Not applicable

Hi all,

 

We are receiving the error message multiple times and we implemented one after insert  Business rule to add some checklist item in work note when ever change is created it is working fine  when there is no error message if we got any error message the checklist item is not getting added but the change is getting created .

 

And for one error message it is showing multiple times we are not able to find root cause

 

can anyone help me on this

 

Thanks

 

Pavithra813_0-1678816126502.png

 

5 REPLIES 5

Anurag Tripathi
Mega Patron
Mega Patron

Do you have any business rule in on the table with current.update() in the script?

-Anurag

Community Alums
Not applicable

Hi @Anurag Tripathi 

 

We don't have current.update() script in any of our Before Business Rule for that table.

 

thanks.

Palak Gupta
Tera Guru
Tera Guru

Hi @Community Alums ,

 

Can you share the Business Rule which you have written? Also, this error occurred after writing the Business Rule or was already coming? Also try to inactivate the Business Rule you created recently and check if this error is still coming or not.

 

Regards,

Palak Gupta 

Community Alums
Not applicable

Hi @Palak Gupta , 

Yes I have checked the error message is showing multiple times after creation of my business rule we checked with deactivating the business rule at that time the error message shown only one time. 

 

 

I created this business rule to attach check list item in the check list template to change request work notes when ever new change request created. 

 

When ever error message is throwing for some other field at that time when change request is created the check list item is not getting attached in change request work notes but it is working fine when there is no error message. 

 

After insert business rule on change_request table

 var theList = new GlideRecord("checklist");
 theList.initialize();
 theList.table = "change_request";
 theList.owner = gs.getUserID();
 theList.document = current.sys_id;
 var listId = theList.insert();

var checklistArr = {};

var grTemplate = new GlideRecord("checklist_template");
grTemplate.addQuery("name", "Global template");
grTemplate.query();
if(grTemplate.next())
{
         checklistArr = JSON.parse(grTemplate.getValue('template'));
 for(var key in checklistArr.items)
         {
               var chki = new GlideRecord('checklist_item');
               chki.initialize();
               chki.setValue('checklist', listId);
               chki.setValue('name', checklistArr.items[key]['name']);
               chki.setValue('order', checklistArr.items[key]['order']);
               chki.insert();
          }

}

 

Thanks,