The CreatorCon Call for Content is officially open! Get started here.

Create a before Insert business rule

DeIvory Gordon
Tera Guru

Hello, I am working on a story with two items: 

 

1. Create a before Insert business rule on 'interaction_related_record' table where document_type = 'Incident', which will copy interaction.journalEntry to incident.description. 

    var gr = new GlideRecord('incident');
    gr.get(current.task);
    gr.description = current.interaction.work_notes.getJournalEntry(-1);
    gr.update();

 

I created the before Insert business rule on the 'interaction_related_record' table and added the above script.  However, Idk where to enter 'document_type = 'Incident'.  I went to "Filter Conditions", but I don't see document_type under "Choose Field".

 

DeIvoryGordon_0-1729617995969.png

 

 

2. Also update the UI Action for Create Interaction and remove the line that currently copies Interaction Activity to incident.description.  I went to Configure, UI Action, Table, entered "Interaction", but I don't think I'm in the right place and I am not sure where to go from here.

 

 

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

Out of the box, there is not a field named 'document_type' on this table, but there is 'document_table', so perhaps this is the actual requirement?  If this field is not populated on your interactions for some reason, you would have to look at the type of the 'task' field value. 

 

On the second point, do you have any UI Actions with the name = 'Create Interaction'?  If not, where - on what form / workspace/... do you see this button?