<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question help with Business role in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/help-with-business-role/m-p/2938984#M150</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Guys, please help me, I'm trying to do a business role where, I take the input journal that a user made and send it to another table, and I have to do the same thing in another table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;I have the tables: x_1316384_terca_problema, x_1316384_terca_resposta.&lt;/SPAN&gt;&amp;nbsp;T&lt;SPAN class=""&gt;he 2 tables inherited the fields from the 'task' table, and I am using the 'number' and 'comments' fields.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;What I have so far is a business role that takes the record created in the x_1316384_terca_problema table and creates it in the x_1316384_terca_resposta table:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function executeRule(current, previous /*null when async*/) {
    var responseRecord = new GlideRecord('x_1316384_terca_resposta');
    responseRecord.initialize();

    responseRecord.comments = current.comments;
    responseRecord.number = current.number;

    responseRecord.insert();
})(current, previous);&lt;/LI-CODE&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;in the options the fields:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;When - before&amp;nbsp; and&amp;nbsp;update - check&lt;/SPAN&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;The problem is, how do I take each journal input that the user puts in the record in table&amp;nbsp;x_1316384_terca_problema and throw this same input into table&amp;nbsp;x_1316384_terca_resposta?&lt;BR /&gt;&lt;SPAN class=""&gt;and how would I do it the other way around?&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;the objective is to somehow establish a conversation between the input journals of each table being referenced by 'number'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 21 May 2024 20:37:21 GMT</pubDate>
    <dc:creator>Arthur Sanchez</dc:creator>
    <dc:date>2024-05-21T20:37:21Z</dc:date>
    <item>
      <title>help with Business role</title>
      <link>https://www.servicenow.com/community/community-central-forum/help-with-business-role/m-p/2938984#M150</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Guys, please help me, I'm trying to do a business role where, I take the input journal that a user made and send it to another table, and I have to do the same thing in another table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;I have the tables: x_1316384_terca_problema, x_1316384_terca_resposta.&lt;/SPAN&gt;&amp;nbsp;T&lt;SPAN class=""&gt;he 2 tables inherited the fields from the 'task' table, and I am using the 'number' and 'comments' fields.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;What I have so far is a business role that takes the record created in the x_1316384_terca_problema table and creates it in the x_1316384_terca_resposta table:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function executeRule(current, previous /*null when async*/) {
    var responseRecord = new GlideRecord('x_1316384_terca_resposta');
    responseRecord.initialize();

    responseRecord.comments = current.comments;
    responseRecord.number = current.number;

    responseRecord.insert();
})(current, previous);&lt;/LI-CODE&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;in the options the fields:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;When - before&amp;nbsp; and&amp;nbsp;update - check&lt;/SPAN&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;The problem is, how do I take each journal input that the user puts in the record in table&amp;nbsp;x_1316384_terca_problema and throw this same input into table&amp;nbsp;x_1316384_terca_resposta?&lt;BR /&gt;&lt;SPAN class=""&gt;and how would I do it the other way around?&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;the objective is to somehow establish a conversation between the input journals of each table being referenced by 'number'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 May 2024 20:37:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/help-with-business-role/m-p/2938984#M150</guid>
      <dc:creator>Arthur Sanchez</dc:creator>
      <dc:date>2024-05-21T20:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: help with Business role</title>
      <link>https://www.servicenow.com/community/community-central-forum/help-with-business-role/m-p/2939014#M151</link>
      <description>&lt;P&gt;Hi, normal practice would be 1 BR on each table that would update the related record on the other table.&lt;BR /&gt;It is considered best practice to use an after BR to update a related record, but this would require query of the journal table in order to find\copy the last 'update' as journal updates are not available via the 'previous' object.&lt;BR /&gt;But while a general guide, ServiceNow do use before BR's to update journal fields and I would use the same approach as it greatly simplifies the solution, however you need to be sure that you will not abort any insert\update and your journal update has run.&lt;BR /&gt;This filter should include some OOB examples&lt;BR /&gt;/sys_script_list.do?sysparm_query=scriptLIKEwork_notes%5EORscriptLIKEcomments%5Ewhen%3Dbefore&amp;amp;sysparm_view=&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 21:10:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/help-with-business-role/m-p/2939014#M151</guid>
      <dc:creator>Tony Chatfield1</dc:creator>
      <dc:date>2024-05-21T21:10:10Z</dc:date>
    </item>
  </channel>
</rss>

