<?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 how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ? in SPM forum</title>
    <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029625#M27601</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have requirement that ,&amp;nbsp;how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?, we have new state filed on the form , if the value changes to "published or retired" then in ,&amp;nbsp; project task under related list, need to restrict creating new tasks?&lt;/P&gt;
&lt;P&gt;Please help to achieve&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Hemachandra&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2022 08:15:19 GMT</pubDate>
    <dc:creator>hemachandra2</dc:creator>
    <dc:date>2022-01-05T08:15:19Z</dc:date>
    <item>
      <title>how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029625#M27601</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have requirement that ,&amp;nbsp;how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?, we have new state filed on the form , if the value changes to "published or retired" then in ,&amp;nbsp; project task under related list, need to restrict creating new tasks?&lt;/P&gt;
&lt;P&gt;Please help to achieve&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Hemachandra&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 08:15:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029625#M27601</guid>
      <dc:creator>hemachandra2</dc:creator>
      <dc:date>2022-01-05T08:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029626#M27602</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Write a Create operation table level ACL on Project Task table and then configure it as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/103950i89C5C3EDF2410CEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So you can give your Field condition above and restrict it say give Roles as Admins in ACL above.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hope this helps. Please mark the answer as correct/helpful based on impact.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Shloke&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 08:25:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029626#M27602</guid>
      <dc:creator>shloke04</dc:creator>
      <dc:date>2022-01-05T08:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029627#M27603</link>
      <description>&lt;P&gt;Hi Shloke ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the response&lt;/P&gt;
&lt;P&gt;ya basically ,we don't want to restrict all the times, only when we creating project in my custom view then only we have to restrict creation of project task, if the project is created in defalut view , so then no need to restrict and the the state field is on the project table and project task is different table&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hemachandra&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 08:35:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029627#M27603</guid>
      <dc:creator>hemachandra2</dc:creator>
      <dc:date>2022-01-05T08:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029628#M27604</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;Please help me on this?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 12:31:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029628#M27604</guid>
      <dc:creator>hemachandra2</dc:creator>
      <dc:date>2022-01-05T12:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029629#M27605</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;There can be other ways to handle this, what I can think of and works for me is listed below:&lt;/P&gt;
&lt;P&gt;1) please create a new hidden field on your Project Table say name it as "View". This is required to capture the view which is getting loaded on Parent Project form and is needed to validate the child Related List.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/103951iB497E3FFF443237B/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2) Now once this field is created, create a UI Policy and hide this field so that it is not visible to users.&lt;/P&gt;
&lt;P&gt;3) Now Please write a Display Business Rule and use the script below to capture the View name:&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
    var view_name = '';
    if (gs.getSession().isInteractive()) {
        var map = gs.action.getGlideURI().getMap();
        if (map.get('sysparm_view') != null) {
            view_name = map.get('sysparm_view').toString();
			g_scratchpad.VIEWNAME = view_name;
        }
    }



})(current, previous);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/103953i3C1F491DBB534641/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/103955iC13CB33E38DDCF76/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now write an On&amp;nbsp;Load&amp;nbsp;Client Script on Project table&amp;nbsp; i.e. View Name and use the script below to set your View Name:&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;function onLoad() {
    //Type appropriate comment here, and begin script below
    g_form.setValue('u_view_name', g_scratchpad.VIEWNAME);

}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/103952i90ABCA47ED98FCCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now once this is done, Right click on the header of Project Task Related List and then select Configure--&amp;gt; List Control as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/103954iD5173BD025F920AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now use the script below in the field "Omit New Condition" as shown below. If this field is not present then add it to the Form layout and then use the same script as shared below:&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;if(parent.u_view_name == 'planning_console'){ // Replace "planning_console" with your custom View Name
	answer = true;
}else{
	answer = false;
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/103956i3029462C799264E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/103967iB3DF24A799EF7495/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;This works for me in my PDI.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hope this helps. Please mark the answer as correct/helpful based on impact.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Shloke&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 12:58:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029629#M27605</guid>
      <dc:creator>shloke04</dc:creator>
      <dc:date>2022-01-05T12:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029630#M27606</link>
      <description>&lt;P&gt;Hi Sholke,&lt;/P&gt;
&lt;P&gt;Thanks for the code,&lt;/P&gt;
&lt;P&gt;ya based on the view, its fine, but i have one more condition that , on the project form i have a custom filed that project state, when ever that filed moved to published then i don't want that new button for project task?, so when should i add that condition in the script?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Hemachandra&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 13:08:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029630#M27606</guid>
      <dc:creator>hemachandra2</dc:creator>
      <dc:date>2022-01-05T13:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029631#M27607</link>
      <description>&lt;P&gt;you just need to add it in the List control script shared. Modifying it again and sharing it below to include this condition as well:&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;if(parent.u_view_name == 'planning_console' || parent.FIELDNAME == 'Put your value here'){ // Replace "planning_console" with your custom View Name
	answer = true;
}else{
	answer = false;
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Replace your Field Name and Value for which you want to hide the New button.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hope this helps. Please mark the answer as correct/helpful based on impact.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Shloke&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 13:51:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029631#M27607</guid>
      <dc:creator>shloke04</dc:creator>
      <dc:date>2022-01-05T13:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029632#M27608</link>
      <description>&lt;P&gt;Hi Shloke,&lt;/P&gt;
&lt;P&gt;Thanks for this&lt;/P&gt;
&lt;P&gt;I tried this whole script to restrict but its not works for me, i don't know where should i wrong?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Hemachandra&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 14:17:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029632#M27608</guid>
      <dc:creator>hemachandra2</dc:creator>
      <dc:date>2022-01-05T14:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to restrict by creating new project task on the project forn when the state filed value changes to published or retired ?</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029633#M27609</link>
      <description>&lt;P&gt;Works for me in my PDI. Can you share the details as comapared to what I have given above so that I can see and assist you further?&lt;/P&gt;
&lt;P&gt;Have you created the Field?&lt;/P&gt;
&lt;P&gt;Have you created the Business Rule and Client script? Is the value in View field getting set correctly?&lt;/P&gt;
&lt;P&gt;Please share to assist you further.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Shloke&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 16:27:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-restrict-by-creating-new-project-task-on-the-project-forn/m-p/1029633#M27609</guid>
      <dc:creator>shloke04</dc:creator>
      <dc:date>2022-01-05T16:27:44Z</dc:date>
    </item>
  </channel>
</rss>

