<?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: Disable renaming or delete/remove attachment option for a table in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563899#M220825</link>
    <description>&lt;P&gt;&lt;SN-MENTION class="sn-mention" table="live_profile" sysid="192e8625dbd41fc09c9ffb651f9619f9"&gt;@Chandu Telu&lt;/SN-MENTION&gt; thsanks for replying and this won't solve my requirement&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2022 09:16:03 GMT</pubDate>
    <dc:creator>Community Alums</dc:creator>
    <dc:date>2022-07-06T09:16:03Z</dc:date>
    <item>
      <title>Disable renaming or delete/remove attachment option for a table</title>
      <link>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563897#M220823</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have a requirement that "&lt;STRONG&gt;only the user who attached that attachment should be able to rename the attachment or delete/remove the attachment others shouldn't&lt;/STRONG&gt;" for a particular table(custom table).&lt;/P&gt;
&lt;P&gt;&lt;SN-MENTION class="sn-mention" table="live_profile" sysid="19525629dbd81fc09c9ffb651f961989"&gt;@Ankur Bawiskar&lt;/SN-MENTION&gt; Any idea?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Bala&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 08:59:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563897#M220823</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2022-07-06T08:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Disable renaming or delete/remove attachment option for a table</title>
      <link>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563898#M220824</link>
      <description>&lt;P&gt;Hi Balaraju,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the below link to hide the rename option you can check the current user and method in below link will hide the Rename Option but it's best practice&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=a823c3e1dbd8dbc01dcaf3231f961956&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;BR /&gt;Chandu Telu&lt;BR /&gt;Please Mark &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; Correct/helpful, if applicable,&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 09:07:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563898#M220824</guid>
      <dc:creator>Chandu Telu</dc:creator>
      <dc:date>2022-07-06T09:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Disable renaming or delete/remove attachment option for a table</title>
      <link>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563899#M220825</link>
      <description>&lt;P&gt;&lt;SN-MENTION class="sn-mention" table="live_profile" sysid="192e8625dbd41fc09c9ffb651f9619f9"&gt;@Chandu Telu&lt;/SN-MENTION&gt; thsanks for replying and this won't solve my requirement&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 09:16:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563899#M220825</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2022-07-06T09:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Disable renaming or delete/remove attachment option for a table</title>
      <link>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563900#M220826</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can try to use before update BR on sys_attachment and check if the logged in user is the created by of that sys_attachment&lt;/P&gt;
&lt;P&gt;For Remove/Delete ensure you have correct table level DELETE ACL&lt;/P&gt;
&lt;P&gt;Actually both your requirements can be handled via before update/delete business rule&lt;/P&gt;
&lt;P&gt;BR: sys_attachment&lt;/P&gt;
&lt;P&gt;Before Update AND Delete&lt;/P&gt;
&lt;P&gt;Condition: &lt;STRONG&gt;current.table_name == 'incident'&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	if(gs.getUserName() != current.sys_created_by){
		gs.addErrorMessage("You are not allowed to update/delete the file as you are not the one who attached it");
		current.setAbortAction(true);
	}

})(current, previous);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 09:28:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563900#M220826</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2022-07-06T09:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Disable renaming or delete/remove attachment option for a table</title>
      <link>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563901#M220827</link>
      <description>&lt;P&gt;Hi @Ankur Bawiskar Everything is fine but SetAbortAction is not working since we are working in scoped application&lt;/P&gt;
&lt;P&gt;Is there any other way to abort?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 10:30:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563901#M220827</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2022-07-06T10:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Disable renaming or delete/remove attachment option for a table</title>
      <link>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563902#M220828</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;create BR in your scope and test once.&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 11:20:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/disable-renaming-or-delete-remove-attachment-option-for-a-table/m-p/1563902#M220828</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2022-07-06T11:20:53Z</dc:date>
    </item>
  </channel>
</rss>

