<?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 Re: how will you generate a new sys_id by scripting in servicenow? in ServiceNow AI Platform forum</title>
    <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187588#M143977</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can use newRecord() method to generate sys_id from script&lt;/P&gt;
&lt;P&gt;Remember unless you insert the record it won't be available in the table&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var rec = new GlideRecord('incident');
rec.newRecord();
gs.info(rec.sys_id);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
    <pubDate>Sun, 23 May 2021 05:48:22 GMT</pubDate>
    <dc:creator>Ankur Bawiskar</dc:creator>
    <dc:date>2021-05-23T05:48:22Z</dc:date>
    <item>
      <title>how will you generate a new sys_id by scripting in servicenow?</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187587#M143976</link>
      <description>&lt;P&gt;how will you generate a new sys_id by scripting in servicenow?&lt;/P&gt;
&lt;P&gt;and What are the different ways to do so?&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 05:38:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187587#M143976</guid>
      <dc:creator>rohan patil2</dc:creator>
      <dc:date>2021-05-23T05:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: how will you generate a new sys_id by scripting in servicenow?</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187588#M143977</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can use newRecord() method to generate sys_id from script&lt;/P&gt;
&lt;P&gt;Remember unless you insert the record it won't be available in the table&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var rec = new GlideRecord('incident');
rec.newRecord();
gs.info(rec.sys_id);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 05:48:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187588#M143977</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2021-05-23T05:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: how will you generate a new sys_id by scripting in servicenow?</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187589#M143978</link>
      <description>&lt;P&gt;In addition to Ankur's newRecord() function, you can also use the below code(Used in server side) :&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;gs.generateGUID()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the sys id of a record that is about to be created on the client side, you can use:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;g_form.getUniqueValue();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 May 2021 06:09:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187589#M143978</guid>
      <dc:creator>AnirudhKumar</dc:creator>
      <dc:date>2021-05-23T06:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: how will you generate a new sys_id by scripting in servicenow?</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187590#M143979</link>
      <description>&lt;P&gt;&lt;SN-MENTION class="sn-mention" table="live_profile" sysid="551a056fdbe66c1066f1d9d968961987"&gt;@rohan patil&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could see you marked my response as correct earlier but now it is not.&lt;/P&gt;
&lt;P&gt;You can mark only 1 response as correct.&lt;/P&gt;
&lt;P&gt;Please mark appropriate response as correct and helpful so that it benefits other members.&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 13:59:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-will-you-generate-a-new-sys-id-by-scripting-in-servicenow/m-p/1187590#M143979</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2021-05-23T13:59:43Z</dc:date>
    </item>
  </channel>
</rss>

