<?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: Need to use a script to write to fields in std_change_proposal in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/need-to-use-a-script-to-write-to-fields-in-std-change-proposal/m-p/2946934#M1117773</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174062"&gt;@Brad Bowman &lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Can you please guide us "How to write a client script on the change request values"?&lt;BR /&gt;The reference qualifiers for the reference fields are not getting applied&lt;BR /&gt;so I have created before query BR to restrict ci's for Business service field.&lt;BR /&gt;this will apply if you click on magnifying glass&lt;BR /&gt;but users are still able to type the restricted ci's and select them manually.&lt;BR /&gt;someone suggested to write a client script and use Ajax,&lt;/P&gt;&lt;P&gt;If i try to retrieve the value, the entire template value is coming, so how can I retrieve single field value from the dropdown?&lt;BR /&gt;Please share your views here.&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2024 14:38:06 GMT</pubDate>
    <dc:creator>Nidubrolr</dc:creator>
    <dc:date>2024-05-29T14:38:06Z</dc:date>
    <item>
      <title>Need to use a script to write to fields in std_change_proposal</title>
      <link>https://www.servicenow.com/community/developer-forum/need-to-use-a-script-to-write-to-fields-in-std-change-proposal/m-p/2686746#M1040922</link>
      <description>&lt;P&gt;I have a record producer for domain migration requests that I created on the std_change_proposal table. On the Standard Change Proposal form there is a tab called "Change Request values" that contains numerous questions (backout plan, test plan, etc). Its on the change_request table.&lt;/P&gt;&lt;P&gt;I want to use the script in my record producer to fill out these questions but i'm having trouble. For example, to test filling in the short description I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var gr = new GlideRecord("std_change_record_producer");&lt;/P&gt;&lt;P&gt;gr.addEncodedQuery(query);&lt;BR /&gt;gr.query();&lt;/P&gt;&lt;P&gt;while (gr.next()){&lt;/P&gt;&lt;P&gt;gr.variables.short_description= 'Test';&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But that didn't do it. Anyone have any suggestions on what I'm doing wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 08:54:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-to-use-a-script-to-write-to-fields-in-std-change-proposal/m-p/2686746#M1040922</guid>
      <dc:creator>Imad Nacer2</dc:creator>
      <dc:date>2023-09-29T08:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need to use a script to write to fields in std_change_proposal</title>
      <link>https://www.servicenow.com/community/developer-forum/need-to-use-a-script-to-write-to-fields-in-std-change-proposal/m-p/2686987#M1040985</link>
      <description>&lt;P&gt;In your attempt 'query' in the addEncodedQuery line is undefined.&amp;nbsp; The Change Request values field is on the std_change_proposal table, so you don't need to do a GlideRecord query in the producer script, rather just use the syntax &lt;STRONG&gt;current.field_name=value&amp;nbsp;&lt;/STRONG&gt;to set a field value.&amp;nbsp; This field (yes, the whole tab is one field) is a little different as one field holds every field and value to be applied in the template, so to populate it in the producer script you would do something like this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;current.setValue('template_value', 'short_description=Test^description=This is only a Test^implementation_plan=Here is what you need to do');
&lt;/LI-CODE&gt;
&lt;P&gt;with as many &lt;STRONG&gt;^field_name=&lt;/STRONG&gt;... additions that you need.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 11:23:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-to-use-a-script-to-write-to-fields-in-std-change-proposal/m-p/2686987#M1040985</guid>
      <dc:creator>Brad Bowman</dc:creator>
      <dc:date>2023-09-29T11:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need to use a script to write to fields in std_change_proposal</title>
      <link>https://www.servicenow.com/community/developer-forum/need-to-use-a-script-to-write-to-fields-in-std-change-proposal/m-p/2946934#M1117773</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174062"&gt;@Brad Bowman &lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Can you please guide us "How to write a client script on the change request values"?&lt;BR /&gt;The reference qualifiers for the reference fields are not getting applied&lt;BR /&gt;so I have created before query BR to restrict ci's for Business service field.&lt;BR /&gt;this will apply if you click on magnifying glass&lt;BR /&gt;but users are still able to type the restricted ci's and select them manually.&lt;BR /&gt;someone suggested to write a client script and use Ajax,&lt;/P&gt;&lt;P&gt;If i try to retrieve the value, the entire template value is coming, so how can I retrieve single field value from the dropdown?&lt;BR /&gt;Please share your views here.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 14:38:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/need-to-use-a-script-to-write-to-fields-in-std-change-proposal/m-p/2946934#M1117773</guid>
      <dc:creator>Nidubrolr</dc:creator>
      <dc:date>2024-05-29T14:38:06Z</dc:date>
    </item>
  </channel>
</rss>

