<?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 User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463312#M35091</link>
    <description>&lt;P style="text-align: center;"&gt;User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification preferences.&lt;/P&gt;
&lt;P style="text-align: center;"&gt;I don't want to change OOB ACLs for this. Could anyone help how notification preferences are created or accessed via system settings--&amp;gt; notification prefrences&lt;/P&gt;</description>
    <pubDate>Sun, 06 Feb 2022 18:14:50 GMT</pubDate>
    <dc:creator>Ajay Sharma2</dc:creator>
    <dc:date>2022-02-06T18:14:50Z</dc:date>
    <item>
      <title>User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463312#M35091</link>
      <description>&lt;P style="text-align: center;"&gt;User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification preferences.&lt;/P&gt;
&lt;P style="text-align: center;"&gt;I don't want to change OOB ACLs for this. Could anyone help how notification preferences are created or accessed via system settings--&amp;gt; notification prefrences&lt;/P&gt;</description>
      <pubDate>Sun, 06 Feb 2022 18:14:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463312#M35091</guid>
      <dc:creator>Ajay Sharma2</dc:creator>
      <dc:date>2022-02-06T18:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463313#M35092</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I don't think that code will be exposed to us how it is being displayed in Gear settings.&lt;/P&gt;
&lt;P&gt;But yes, reason why user are not able to create new record in cmn_notif_device table is because of an OOB ACL which check if current logged in user is same as the value present in User field or not and also for New Records with help of below condition:&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;current.isNewRecord() || current.user == gs.getUserID()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Link for the ACL below:&lt;/P&gt;
&lt;P&gt;https://instance.service-now.com/nav_to.do?uri=sys_security_acl.do?sys_id=7e0faa45c0a80166608da235042e06a0&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Replace "instance' with your instance name.&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>Sun, 06 Feb 2022 19:42:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463313#M35092</guid>
      <dc:creator>shloke04</dc:creator>
      <dc:date>2022-02-06T19:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463314#M35093</link>
      <description>Hi @shloke4
I am using the same user while trying to create new record.
I can't see new button while accessing the table but if I use sys_id as -1 in query parameter i can create new records using the end user.
Issue is only with those user who are having only snc_internal role.</description>
      <pubDate>Sun, 06 Feb 2022 19:52:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463314#M35093</guid>
      <dc:creator>Ajay Sharma2</dc:creator>
      <dc:date>2022-02-06T19:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463315#M35094</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="11b29aaddbd81fc09c9ffb651f9619fd"&gt;@Ajay Sharma&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is bit confusing the way it's been designed OOB. There are two things here which need to be mention to make you understand:&lt;/P&gt;
&lt;P&gt;1) User logged in to System has access or not to create record in Notification Device Table.&lt;/P&gt;
&lt;P&gt;2) Visibility of New button on the same Table.&lt;/P&gt;
&lt;P&gt;Let me explain as below:&lt;/P&gt;
&lt;P&gt;1) As mentioned before as well there is a ACL which check to allow user to create record only when the User field on "Notification Device " table is same as current logged in user&amp;nbsp;or not. This is checked in ACL which I have shared above.&lt;/P&gt;
&lt;P&gt;Now when you modify the query and directly try to create a New record by having sys_id = -1, On Notification Device Table ServiceNow set the current logged in User as a Default value on the User field which satisfy the ACL script and hence you are able to create record when you give sys_id=-1.&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/21899i6CF9E6CE2E07065B/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;This default value is set as shown below in the dictionary of User field:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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/21900i0DA3408ED1F0ADF8/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 coming to the New button visibility, that looks like a button on the Global Table itself which might be possible that user might not have access to View that button.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I have verified that there is no such button on Notification Device Table. So what you can do is create a New button on Notification Device table and that should solve your issue and resolve this confusion as well. The issue is not with the ACL as any user on the platform can create Notification Channel&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UI Action Script:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;var url = '/cmn_notif_device.do?sys_id=-1&amp;amp;sys_is_list=true&amp;amp;sys_target=cmn_notif_device&amp;amp;sysparm_checked_items=&amp;amp;sysparm_fixed_query=&amp;amp;sysparm_group_sort=&amp;amp;sysparm_list_css=&amp;amp;sysparm_query=&amp;amp;sysparm_referring_url=cmn_notif_device_list.do&amp;amp;sysparm_target=&amp;amp;sysparm_view=';
action.setRedirectURL(url);&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/21901iE5CC9F57203C653E/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;What this UI Action will do is override the current New Button and end user will now be able to create Channel as you want.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This is working for me in my PDI.&lt;/STRONG&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>Mon, 07 Feb 2022 07:47:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463315#M35094</guid>
      <dc:creator>shloke04</dc:creator>
      <dc:date>2022-02-07T07:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463316#M35095</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="80a0926ddb581fc09c9ffb651f9619db"&gt;@shloke04&lt;/SN-MENTION&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply. But this is not about creating new UI Action. The actual problem I want to solve here is I have created "Notification preferences" widget as per this link&lt;/P&gt;
&lt;P&gt;"https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=dad9ccd9db03af00d6a102d5ca961975"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now if user clicks on "Create Channel" link&amp;nbsp; I get error like "Record not found".&lt;/P&gt;
&lt;P&gt;But user is able to read/edit previously created channels/device.&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/21898iBFBBA7A604F1740E/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/21905i8141FDC0E9F34B90/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;</description>
      <pubDate>Mon, 07 Feb 2022 08:05:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463316#M35095</guid>
      <dc:creator>Ajay Sharma2</dc:creator>
      <dc:date>2022-02-07T08:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463317#M35096</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="11b29aaddbd81fc09c9ffb651f9619fd"&gt;@Ajay Sharma&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would strongly suggest here to mention your requirement with details when posting a question and not a susbset of what you are looking for.&lt;/P&gt;
&lt;P&gt;This will help both you and the person helping you not to waste their effort and time in the wrong direction.&lt;/P&gt;
&lt;P&gt;Till now we were spending time in the wrong direction, with you trying to use a custom functionality here.&lt;/P&gt;
&lt;P&gt;Would suggest to check with the user of the custom functionality as I do not have an idea on what has been custom created for this functionality.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Shloke&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 08:39:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463317#M35096</guid>
      <dc:creator>shloke04</dc:creator>
      <dc:date>2022-02-07T08:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463318#M35097</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="80a0926ddb581fc09c9ffb651f9619db"&gt;@shloke04&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't get me wrong here. Thing is user is not able to create new records/see his notification devices using Application navigator. But he can via system settings-&amp;gt; Notification preferences.&lt;/P&gt;
&lt;P&gt;If i remove the below condition from ACL, user is allowed to make the changes. But I don't want to change OOB ACLs here&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;current.isNewRecord() || current.user == gs.getUserID()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Ajay&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 09:29:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463318#M35097</guid>
      <dc:creator>Ajay Sharma2</dc:creator>
      <dc:date>2022-02-07T09:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463319#M35098</link>
      <description>&lt;P&gt;Can you post the Widget code here the complete code which you are trying to use from the custom solution provided and also some screenshot of the steps how are you testing it when you are getting that error.&lt;/P&gt;
&lt;P&gt;I will try that out in my PDI and try to assist you on what can be a solution to your issue.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Shloke&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 11:32:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463319#M35098</guid>
      <dc:creator>shloke04</dc:creator>
      <dc:date>2022-02-07T11:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463320#M35099</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="80a0926ddb581fc09c9ffb651f9619db"&gt;@shloke04&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Update set is present is mentioned link as attachment&amp;nbsp;&lt;A title="Notification Preferences in Service Portal" href="https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=dad9ccd9db03af00d6a102d5ca961975"&gt;https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=dad9ccd9db03af00d6a102d5ca961975&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. After commiting the update set, widget "Custom Notification Preferences" will be created in your instance.&lt;/P&gt;
&lt;P&gt;2. Map this with user profile page&lt;/P&gt;
&lt;P&gt;3. Try to create new channel using user with only "snc_internal" role&lt;/P&gt;
&lt;P&gt;4. click on "Create channel"&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/21904iE6C41EF7672D2CED/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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5. Record not found message will appear&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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/21919i34DAEC72E1B42CC7/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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Ajay&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 12:08:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463320#M35099</guid>
      <dc:creator>Ajay Sharma2</dc:creator>
      <dc:date>2022-02-07T12:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces</title>
      <link>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463321#M35100</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="80a0926ddb581fc09c9ffb651f9619db"&gt;@shloke04&lt;/SN-MENTION&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have identified the issue and bypassed the ACL by creating new widget(cloning widget-form). Now, form is visible to user to create new record but when user clicks on "Save" button on form, record is not getting saved forusers with only "snc_internal" role:&lt;/P&gt;
&lt;P&gt;I believe bypassing ACL while clicking on save button will solve the issue here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Widget code is mentioned below:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;HTML&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;lt;div ng-if="::!data.isValid &amp;amp;&amp;amp; !data.emptyStateTemplate" class="panel panel-default"&amp;gt;&lt;BR /&gt; &amp;lt;div class="panel-body wrapper-lg text-center"&amp;gt;&lt;BR /&gt; &amp;lt;span ng-if="!data.tableUnsupported"&amp;gt;${Record not found}&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;span ng-if="data.tableUnsupported"&amp;gt;${Form view not supported for requested table}&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;div ng-if="!data.isValid &amp;amp;&amp;amp; data.emptyStateTemplate" class="panel-shift"&amp;gt;&lt;BR /&gt; &amp;lt;div class="empty-state-wrapper panel panel-default" ng-include="data.emptyStateTemplate"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;div ng-if="data.isValid" class="panel-shift"&amp;gt;&lt;BR /&gt; &amp;lt;div class="" ng-if="!data.f._view.length &amp;amp;&amp;amp; data.hideRelatedLists &amp;amp;&amp;amp; data.emptyStateTemplate"&amp;gt;&lt;BR /&gt; &amp;lt;div class="empty-state-wrapper panel panel-default" ng-include="data.emptyStateTemplate"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;div class="" ng-if="!data.f._view.length &amp;amp;&amp;amp; data.hideRelatedLists &amp;amp;&amp;amp; !data.emptyStateTemplate"&amp;gt;&lt;BR /&gt; &amp;lt;div class="panel panel-default"&amp;gt;&lt;BR /&gt; &amp;lt;div class="panel-heading"&amp;gt;&amp;lt;span class="panel-title"&amp;gt;{{data.f.title}}&amp;lt;/span&amp;gt; &amp;lt;span ng-if="::options.showFormView == 'true' &amp;amp;&amp;amp; data.f.view != ''"&amp;gt;[{{data.f.view_title}} view]&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="panel-body wrapper-lg text-center"&amp;gt;&lt;BR /&gt; ${No elements to display}&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;!-- readOnly due to scope --&amp;gt;&lt;BR /&gt; &amp;lt;div ng-if="isPageReady &amp;amp;&amp;amp; data.f.outOfScope" class="read-only-message"&amp;gt;&lt;BR /&gt; &amp;lt;div class="alert alert-info sp-cross-scope" role="alert"&amp;gt;&lt;BR /&gt; &amp;lt;p&amp;gt;${This record is in the &amp;lt;strong&amp;gt;{{data.f.recordScopeLabel}}&amp;lt;/strong&amp;gt; application, but &amp;lt;strong&amp;gt;{{data.f.currentScopeLabel}}&amp;lt;/strong&amp;gt; is the current application.}&amp;lt;/p&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div ng-show="isPageReady" class="panel panel-default" ng-if="data.f._view.length || !data.hideRelatedLists" &amp;gt;&lt;BR /&gt; &amp;lt;div class="panel-heading" ng-if="data.f.title.length" sp-context-menu="getUIActionContextMenu(event)"&amp;gt;&lt;BR /&gt; &amp;lt;span class="dropdown m-r-xs" ng-if="(data.isAdmin || getUIActions('context').length &amp;gt; 0) &amp;amp;&amp;amp; options.omitHeaderOptions != 'true'"&amp;gt;&lt;BR /&gt; &amp;lt;button aria-label="${Form menu}" class="btn btn-form-menu dropdown-toggle glyphicon glyphicon-menu-hamburger" style="line-height: 1.4em" id="adminMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&amp;gt;&amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;ul class="dropdown-menu" aria-labelledby="adminMenu"&amp;gt;&lt;BR /&gt; &amp;lt;li ng-if="::data.isAdmin"&amp;gt;&amp;lt;a ng-href="/{{data.f.table}}.do?sys_id={{data.f.sys_id}}&amp;amp;sysparm_view={{data.f.view}}" target="_blank"&amp;gt;${Open in platform}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li ng-if="::data.isAdmin" class="dropdown-header"&amp;gt;${Configure}&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li ng-if="::data.isAdmin"&amp;gt;&amp;lt;a href="/slushbucket.do?sysparm_referring_url={{adminMenu.encodedPageUrl}}&amp;amp;sysparm_list={{data.f._sections[0].id}}&amp;amp;sysparm_form=section&amp;amp;sysparm_view={{data.f.view}}" target="_blank"&amp;gt;${Form Layout}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li ng-if="::data.isAdmin"&amp;gt;&amp;lt;a href="/slushbucket.do?sysparm_referring_url={{adminMenu.encodedPageUrl}}&amp;amp;sysparm_list={{data.f.table}}&amp;amp;sysparm_form=related_list&amp;amp;sysparm_view={{data.f.view}}" target="_blank"&amp;gt;${Related Lists}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li ng-if="::data.isAdmin"&amp;gt;&amp;lt;a href="?id=lf&amp;amp;table=sys_ui_policy&amp;amp;filter=table%3D{{data.f.table}}%5EORtableIN{{data.tableHierarchy}}%5Eactive%3Dtrue%5Eui_type%3D1%5EORui_type%3D10" ng-click="openRelatedList($event, {id:'lf', table: 'sys_ui_policy', filter: 'table%3D{{data.f.table}}%5EORtableIN{{data.f.table}},sys_metadata%5Eactive%3Dtrue%5Eui_type%3D1%5EORui_type%3D10'})"&amp;gt;${UI Policies} &amp;lt;span class="badge pull-right" ng-if="f.policy.length"&amp;gt;{{f.policy.length}}&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li ng-if="::data.isAdmin"&amp;gt;&amp;lt;a href="?id=lf&amp;amp;table=sys_script_client&amp;amp;filter=table%3D{{data.f.table}}%5EORtableIN{{data.tableHierarchy}}%5Eactive%3Dtrue%5Eui_type%3D1%5EORui_type%3D10" ng-click="openRelatedList($event, {id: 'lf', table: 'sys_script_client', filter: 'table%3D{{data.f.table}}%5EORtableIN{{data.f.table}},sys_metadata%5Eactive%3Dtrue%5Eui_type%3D1%5EORui_type%3D10'})"&amp;gt;${Client Scripts} &amp;lt;span class="badge pull-right" ng-if="adminMenu.getClientScriptCount()"&amp;gt;{{adminMenu.getClientScriptCount()}}&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li ng-if="getUIActions('context').length &amp;gt; 0 &amp;amp;&amp;amp; data.isAdmin" role="separator" class="divider"&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li ng-repeat="action in getUIActions('context')"&amp;gt;&amp;lt;a href="" ng-click="triggerUIAction(action)"&amp;gt;{{action.name}}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li ng-if="::data.isAdmin || getUIActions('context').length &amp;gt; 0" role="separator" class="divider"&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li&amp;gt;&amp;lt;a target="_new" href="/{{data.f.table}}.do?PDF&amp;amp;sys_id={{data.sys_id}}&amp;amp;sysparm_view={{data.f.view}}"&amp;gt;${Export to PDF}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;li&amp;gt;&amp;lt;a target="_new" href="/{{data.f.table}}.do?PDF&amp;amp;landscape=true&amp;amp;sys_id={{data.sys_id}}&amp;amp;sysparm_view={{data.f.view}}"&amp;gt;${Export to PDF (landscape)}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;/ul&amp;gt;&lt;BR /&gt; &amp;lt;/span&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;!-- optional "Open in platform" link when omitHeaderOptions is true --&amp;gt;&lt;BR /&gt; &amp;lt;span class="dropdown m-r-xs" ng-if="::data.isAdmin &amp;amp;&amp;amp; options.omitHeaderOptions == 'true' &amp;amp;&amp;amp; options.ensurePlatformLink == 'true'"&amp;gt;&lt;BR /&gt; &amp;lt;button aria-label="${Form menu}" class="btn btn-form-menu dropdown-toggle glyphicon glyphicon-menu-hamburger" style="line-height: 1.4em" id="platformLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&amp;gt;&amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;ul class="dropdown-menu" aria-labelledby="platformLink"&amp;gt;&lt;BR /&gt; &amp;lt;li&amp;gt;&amp;lt;a ng-href="/{{data.f.table}}.do?sys_id={{data.f.sys_id}}&amp;amp;sysparm_view={{data.f.view}}" target="_blank"&amp;gt;${Open in platform}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;/ul&amp;gt;&lt;BR /&gt; &amp;lt;/span&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;span class="panel-title" role="heading" aria-level="2"&amp;gt;{{data.f.title}}&amp;lt;/span&amp;gt; &amp;lt;span ng-if="::options.showFormView == 'true' &amp;amp;&amp;amp; data.f.view != ''"&amp;gt;[{{data.f.view_title}} view]&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;div ng-if="::attachmentHandler &amp;amp;&amp;amp; data.canAttach" title="{{::data.addAttachmentMsg}}" class="pull-right attachment-button"&amp;gt;&lt;BR /&gt; &amp;lt;sp-attachment-button&amp;gt;&amp;lt;/sp-attachment-button&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="panel-body"&amp;gt;&lt;BR /&gt; &amp;lt;!-- performance debug --&amp;gt;&lt;BR /&gt; &amp;lt;div ng-if="data.show_sql"&amp;gt;&lt;BR /&gt; &amp;lt;div class="comment"&amp;gt;&lt;BR /&gt; &amp;lt;span ng-if="data.f._perf.sql_count"&amp;gt;${SQL Statements {{data.f._perf.sql_count}}}, &amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;span&amp;gt;${Time {{data.f._perf.time}}}&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div ng-repeat="s in data.f._perf.sql" class="{{s.type}}"&amp;gt;&lt;BR /&gt; {{s.statement}}&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;!-- attachments --&amp;gt;&lt;BR /&gt; &amp;lt;sp-attachment-manager table="::data.table" sys-id="data.f._attachmentGUID" omit-edit="::!data.canAttach"&amp;gt;&amp;lt;/sp-attachment-manager&amp;gt;&lt;BR /&gt; &amp;lt;!-- form --&amp;gt;&lt;BR /&gt; &amp;lt;div&amp;gt;&lt;BR /&gt; &amp;lt;sp-model form_model="data.f" mandatory="mandatory"&amp;gt;&amp;lt;/sp-model&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;!-- UI Action Links --&amp;gt;&lt;BR /&gt; &amp;lt;div ng-if="getUIActions('link').length &amp;gt; 0"&amp;gt;&lt;BR /&gt; &amp;lt;label style="margin: 0;"&amp;gt;${Related Links}&amp;lt;/label&amp;gt;&lt;BR /&gt; &amp;lt;div ng-repeat="action in getUIActions('link')"&amp;gt;&lt;BR /&gt; &amp;lt;a href ng-click="triggerUIAction(action)" gsft_id="{{::action.sys_id}}"&amp;gt;{{::action.name}}&amp;lt;/a&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;!-- related lists --&amp;gt;&lt;BR /&gt; &amp;lt;div ng-if="!data.hideRelatedLists"&amp;gt;&lt;BR /&gt; &amp;lt;label style="margin: 0"&amp;gt;${Related Lists}&amp;lt;/label&amp;gt;&lt;BR /&gt; &amp;lt;div style="margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px solid #f5f5f5;"&amp;gt;&lt;BR /&gt; &amp;lt;span ng-repeat="rl in data.f._related_lists" ng-if="rl.visible"&amp;gt;&lt;BR /&gt; &amp;lt;a ng-if="rl.type != 'REL'" ng-href="?id=lf&amp;amp;table={{::rl.table}}&amp;amp;filter={{rl.field}}%3D{{data.f.sys_id}}{{rl.filter ? '^' + rl.filter : ''}}&amp;amp;view={{data.f.view}}" ng-click="openRelatedList($event, {id: 'lf', table: '{{::rl.table}}', filter: '{{rl.field}}%3D{{data.f.sys_id}}'})"&amp;gt;{{rl.plural}}&lt;BR /&gt; &amp;lt;span class="label label-as-badge label-primary" ng-if="rl.count"&amp;gt;{{::rl.count}}&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/a&amp;gt;&lt;BR /&gt; &amp;lt;a ng-if="::rl.type == 'REL'" href="?id=lf&amp;amp;table={{::rl.table}}&amp;amp;relationship_id={{rl.relationship_id}}&amp;amp;apply_to={{rl.apply_to}}&amp;amp;apply_to_sys_id={{rl.apply_to_sys_id}}&amp;amp;view={{::data.f.view}}" ng-click="openRelatedList($event, {id: 'lf', table: '{{::rl.table}}', apply_to: '{{rl.apply_to}}', apply_to_sys_id: '{{rl.apply_to_sys_id}}', relationship_id: '{{rl.relationship_id}}'})"&amp;gt;{{rl.label}}&lt;BR /&gt; &amp;lt;span class="label label-as-badge label-primary" ng-if="rl.count"&amp;gt;{{rl.count}}&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/a&amp;gt;&lt;BR /&gt; &amp;lt;span ng-if="!$last" style="padding-left: .5em; padding-right: .5em;" aria-hidden="true"&amp;gt; | &amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;div class="panel-footer"&amp;gt;&lt;BR /&gt; &amp;lt;button ng-click="triggerUIAction(action)" ng-disabled="submitting" ng-repeat="action in getUIActions('button')" class="btn action-btn" ng-class="::getButtonClass(action)" gsft_id="{{::action.sys_id}}"&amp;gt;{{action.name}}&amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;span&amp;gt;{{status}}&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;button ng-if="getPrimaryAction()" type="submit" ng-click="triggerUIAction(getPrimaryAction())" ng-disabled="submitting" class="btn btn-primary action-btn pull-right" gsft_id="{{::getPrimaryAction().sys_id ? getPrimaryAction().sys_id : ''}}"&amp;gt;${Save} &amp;lt;span ng-if="saveButtonSuffix"&amp;gt;(${{{saveButtonSuffix}}})&amp;lt;/span&amp;gt;&amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;div style="clear: both;"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div ng-if="mandatory.length" class="alert alert-info" style="margin-top: .5em" aria-live="polite" aria-atomic="true"&amp;gt;&lt;BR /&gt; &amp;lt;span ng-if="mandatory.length &amp;gt; 0"&amp;gt;${Required information} &amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;span ng-repeat="f in mandatory" class="label sc-field-error-label" ng-bind="f.label"&amp;gt;&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CSS:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.btn-form-menu {&lt;BR /&gt; vertical-align: inherit;&lt;BR /&gt; padding: inherit;&lt;BR /&gt; background: none;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.panel-title {&lt;BR /&gt; word-wrap: break-word;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.panel-heading {&lt;BR /&gt; .dropdown-menu {&lt;BR /&gt; a {&lt;BR /&gt; white-space: normal;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.sc-field-error-label {&lt;BR /&gt; margin-right: .5em;&lt;BR /&gt; display: inline-block;&lt;BR /&gt; background-color: $sc-field-error-color;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.comment {&lt;BR /&gt; font-weight: bold;&lt;BR /&gt; margin-top: 2px;&lt;BR /&gt; margin-bottom: 2px;&lt;BR /&gt;}&lt;BR /&gt;.mce-panel, .mce-btn {&lt;BR /&gt; background-image: none;&lt;BR /&gt; background-color: #f0f3f4;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.action-btn {&lt;BR /&gt; margin-right: 5px;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.timeline-container {&lt;BR /&gt; max-height: 50vh;&lt;BR /&gt; height: 100%;&lt;BR /&gt; overflow-y: auto;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.panel .panel {&lt;BR /&gt; height: auto !important;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.attachment-button {&lt;BR /&gt; .glyphicon-paperclip {&lt;BR /&gt; font-size: 18px;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.empty-state-wrapper {&lt;BR /&gt; width: 100%;&lt;BR /&gt; height: 100%;&lt;BR /&gt; align-items: center;&lt;BR /&gt; display: flex;&lt;BR /&gt; flex-direction: column;&lt;BR /&gt; padding: 10vh 20px 20px;&lt;/P&gt;
&lt;P&gt;.empty-state {&lt;BR /&gt; border: 1px solid #e7e9eb;&lt;BR /&gt; border-radius: 10px;&lt;BR /&gt; max-width: 700px;&lt;BR /&gt; padding: 30px 40px 20px;&lt;BR /&gt; position: relative;&lt;/P&gt;
&lt;P&gt;.empty-state-badge {&lt;BR /&gt; top: -36px;&lt;BR /&gt; left: 50%;&lt;BR /&gt; position: absolute;&lt;BR /&gt; height: 72px;&lt;BR /&gt; width: 72px;&lt;BR /&gt; -webkit-align-items: center;&lt;BR /&gt; -ms-flex-align: center;&lt;BR /&gt; align-items: center;&lt;BR /&gt; border-radius: 100%;&lt;BR /&gt; color: #ffffff;&lt;BR /&gt; display: -webkit-flex;&lt;BR /&gt; display: -ms-flexbox;&lt;BR /&gt; display: flex;&lt;BR /&gt; font-size: 40px;&lt;BR /&gt; -webkit-justify-content: center;&lt;BR /&gt; -ms-flex-pack: center;&lt;BR /&gt; justify-content: center;&lt;BR /&gt; margin-left: -36px;&lt;BR /&gt; text-align: center;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;.empty-state-header {&lt;BR /&gt; font-size: 30px;&lt;BR /&gt; text-align: center;&lt;BR /&gt; color: #343d47;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;.empty-state-content {&lt;BR /&gt; ul {&lt;BR /&gt; list-style: disc outside;&lt;BR /&gt; margin: 0 0 10px 0;&lt;BR /&gt; padding: 0 0 0 30px;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.text-success-alt {&lt;BR /&gt; background-color: $state-success-text;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.text-info-alt {&lt;BR /&gt; background-color: $state-info-text;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.sp-cross-scope-msg {&lt;BR /&gt; margin-bottom: 10px;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;.mce-statusbar, .mce-edit-area, .mce-tinymce {&lt;BR /&gt; border-color: $input-border;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Server:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;// form functionality - URL parameter driven&lt;BR /&gt;(function($sp, input, data, options, gs) {&lt;BR /&gt; /* "use strict"; -linter issues */&lt;BR /&gt; // populate the 'data' variable&lt;BR /&gt; data.attachmentUploadSuccessMsg = gs.getMessage("Attachment upload was successful");&lt;BR /&gt; data.recordAddedMsg = gs.getMessage("Record Added");&lt;BR /&gt; data.updatedMsg = gs.getMessage("updated_uppercase");&lt;BR /&gt; data.exportPDFMsg = gs.getMessage("Export to PDF");&lt;BR /&gt; data.exportPDFLandMsg = gs.getMessage("Export to PDF (landscape)");&lt;BR /&gt; data.addAttachmentMsg = gs.getMessage("Add an attachment");&lt;BR /&gt; data.maxAttachmentSize = parseInt(gs.getProperty("com.glide.attachment.max_size", 1024));&lt;BR /&gt; if (isNaN(data.maxAttachmentSize))&lt;BR /&gt; data.maxAttachmentSize = 24;&lt;BR /&gt; data.largeAttachmentMsg = gs.getMessage("Attached files must be smaller than {0} - please try again", "" + data.maxAttachmentSize + "MB");&lt;BR /&gt; &lt;BR /&gt; data.isAdmin = gs.hasRightsTo('sp/configure.all/execute', null);&lt;BR /&gt; data.emptyStateTemplate = options.empty_state_template;&lt;BR /&gt; var isPopup = false;&lt;/P&gt;
&lt;P&gt;if (input) {&lt;BR /&gt; data.table = input.table;&lt;BR /&gt; data.sys_id = input.sys_id;&lt;BR /&gt; data.view = input.view;&lt;BR /&gt; data.query=input.query;&lt;BR /&gt; var result = {};&lt;BR /&gt; if (input._fields) {&lt;BR /&gt; result = $sp.saveRecord(input.table, input.sys_id, input._fields);&lt;BR /&gt; data.sys_id = result.sys_id;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;//if (input.sys_id == '-1')&lt;BR /&gt; data.isNewRecord = true;&lt;BR /&gt; if (input.isPopup === true)&lt;BR /&gt; isPopup = true;&lt;BR /&gt; } else {&lt;BR /&gt; data.table = options.table || $sp.getParameter("t") || $sp.getParameter("table") || $sp.getParameter("sl_table");&lt;BR /&gt; data.sys_id = options.sys_id || $sp.getParameter("sys_id") || $sp.getParameter("sl_sys_id");&lt;BR /&gt; if (!data.sys_id &amp;amp;&amp;amp; options.sys_id_required != "true")&lt;BR /&gt; data.sys_id = "-1";&lt;BR /&gt; data.view = options.view || $sp.getParameter("view") || $sp.getParameter("v"); // no default&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;if (isPopup &amp;amp;&amp;amp; gs.getProperty("glide.service_portal.reference.use_sys_popup_view", "false") == "true") {&lt;BR /&gt; options.hideRelatedLists = true;&lt;BR /&gt; options.disableUIActions = "true";&lt;BR /&gt; }&lt;BR /&gt; data.hideRelatedLists = options.hideRelatedLists || false;&lt;BR /&gt; data.disableUIActions = options.disableUIActions === "true";&lt;BR /&gt; &lt;BR /&gt; //data.query = $sp.getParameter("query") || options.query || "";&lt;BR /&gt; data.f = {};&lt;BR /&gt; if (!data.table)&lt;BR /&gt; return;&lt;BR /&gt; &lt;BR /&gt; // Form widget is not a supported way to view an attachment&lt;BR /&gt; if (data.table == "sys_attachment") {&lt;BR /&gt; data.tableUnsupported = true;&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;if (!GlideTableDescriptor.isValid(data.table))&lt;BR /&gt; return;&lt;/P&gt;
&lt;P&gt;if (!data.sys_id)&lt;BR /&gt; return;&lt;/P&gt;
&lt;P&gt;var rec = $sp.getRecord(data.table, data.sys_id);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; &lt;BR /&gt; if (data.sys_id != "-1" &amp;amp;&amp;amp; !rec.canRead())&lt;BR /&gt; return; // can't see requested record&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; if (data.table != "cmn_notif_device") {&lt;BR /&gt; &lt;BR /&gt; if (data.sys_id == "-1" &amp;amp;&amp;amp; !rec.canCreate())&lt;BR /&gt; return; // can't create a new record&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; data.isValid = rec.isValid() || data.sys_id == "-1";&lt;BR /&gt; if (!data.isValid)&lt;BR /&gt; return;&lt;/P&gt;
&lt;P&gt;data.table = rec.getRecordClassName();&lt;BR /&gt; data.tableHierarchy = GlideDBObjectManager.getTables(data.table).toArray().join();&lt;BR /&gt; data.canWrite = rec.canWrite();&lt;BR /&gt; var hasRecordAccess = data.sys_id == "-1" ? rec.canCreate() : data.canWrite;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; if (data.table == "cmn_notif_device") {&lt;BR /&gt; hasRecordAccess=true;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; data.canAttach = !options.omitAttachmentButton &amp;amp;&amp;amp; hasRecordAccess &amp;amp;&amp;amp; gs.hasRole(gs.getProperty('glide.attachment.role')) &amp;amp;&amp;amp; !GlideTableDescriptor.get(data.table).getED().getBooleanAttribute("no_attachment");&lt;BR /&gt; data.f = $sp.getForm(data.table, data.sys_id, data.query, data.view, isPopup);&lt;/P&gt;
&lt;P&gt;// PRB1335036: show appropriate message when record is in cross app scope&lt;BR /&gt; data.f.outOfScope = !rec.isInSelectedScope();&lt;BR /&gt; // Populate scope labels only when needed&lt;BR /&gt; if (data.f.outOfScope) {&lt;BR /&gt; data.f.recordScopeLabel = gs.getScopeLabelByRecordId(rec.getUniqueValue());&lt;BR /&gt; data.f.currentScopeLabel = gs.getCurrentApplicationName();&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; // Activity formatter is hardcoded to set specific options&lt;BR /&gt; for (var f in data.f._formatters) {&lt;BR /&gt; var fm = data.f._formatters[f];&lt;BR /&gt; if (fm.formatter == "activity.xml") {&lt;BR /&gt; fm.hardcoded = true;&lt;BR /&gt; fm.widgetInstance = $sp.getWidget('widget-ticket-conversation',&lt;BR /&gt; {table: data.table,&lt;BR /&gt; sys_id: data.sys_id,&lt;BR /&gt; includeExtended: true,&lt;BR /&gt; hideAttachmentBtn: true,&lt;BR /&gt; title: "${Activity}",&lt;BR /&gt; use_dynamic_placeholder: true,&lt;BR /&gt; btnLabel: "${Post}"});&lt;BR /&gt; } else if(fm.formatter == "com_glideapp_servicecatalog_veditor" || fm.formatter == "com_glideapp_questionset_default_question_editor") {&lt;BR /&gt; var qsConfig = $sp.getValue('quick_start_config');&lt;BR /&gt; if (qsConfig)&lt;BR /&gt; qsConfig = JSON.parse(qsConfig)[0];&lt;BR /&gt; fm.widgetInstance = $sp.getWidget(fm.widget, {table: data.table,&lt;BR /&gt; sys_id: data.sys_id,&lt;BR /&gt; readonly_variable_editor: qsConfig ? qsConfig.readonly_variable_editor : 'false'});&lt;BR /&gt; } else&lt;BR /&gt; fm.widgetInstance = $sp.getWidget(fm.widget, data);&lt;BR /&gt; }&lt;BR /&gt;})($sp, input, data, options, gs);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Client controller:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;function($rootScope, $scope, $timeout, $location, $log, $window, spUtil, nowAttachmentHandler, spAriaUtil, spNavStateManager) {&lt;BR /&gt; $scope.submitting = false;&lt;BR /&gt; $scope.mandatory = [];&lt;BR /&gt; $scope.errorMessages = [];&lt;BR /&gt; $scope.data.show_sql = false;&lt;BR /&gt; $scope.saveButtonSuffix = spUtil.getAccelerator('s');&lt;BR /&gt; $scope.isPageReady = false;&lt;BR /&gt; $scope.embeddedInModal = false;&lt;BR /&gt; $scope.adminMenu = {&lt;BR /&gt; encodedPageUrl: encodeURIComponent($location.url()),&lt;BR /&gt; getClientScriptCount: function() {&lt;BR /&gt; var count = 0;&lt;BR /&gt; if ($scope.data.f.client_script) {&lt;BR /&gt; count += $scope.data.f.client_script.onChange.length;&lt;BR /&gt; count += $scope.data.f.client_script.onLoad.length;&lt;BR /&gt; count += $scope.data.f.client_script.onSubmit.length;&lt;BR /&gt; }&lt;BR /&gt; return count;&lt;BR /&gt; }&lt;BR /&gt; };&lt;BR /&gt; var tableId = $scope.data.sys_id != -1 ? $scope.data.sys_id : ($scope.data.f ? $scope.data.f._attachmentGUID : -1);&lt;BR /&gt; spUtil.recordWatch($scope, "sys_attachment", "table_sys_id=" + tableId, function (response, data) {&lt;BR /&gt; $scope.attachmentHandler.getAttachmentList();&lt;BR /&gt; if (response.data) {&lt;BR /&gt; var options = {};&lt;BR /&gt; options.operation = response.data.operation;&lt;BR /&gt; options.filename = response.data.display_value;&lt;BR /&gt; options.sys_id = tableId;&lt;BR /&gt; options.table = $scope.data.table;&lt;BR /&gt; options.state = (response.data.record &amp;amp;&amp;amp; response.data.record.state) ? response.data.record.state.value : "";&lt;BR /&gt; if (options.operation === 'update' &amp;amp;&amp;amp; options.state === 'not_available')&lt;BR /&gt; $rootScope.$broadcast("attachment.updated", options);&lt;BR /&gt; }&lt;BR /&gt;});&lt;BR /&gt; &lt;BR /&gt; $rootScope.$on('$sp.html.editor.progress', function(e, conf) {&lt;BR /&gt; $scope.submitting = conf.state;&lt;BR /&gt; });&lt;/P&gt;
&lt;P&gt;$scope.getButtonClass = function(action) {&lt;BR /&gt; if (action.form_style == "destructive")&lt;BR /&gt; return "btn-danger";&lt;BR /&gt; &lt;BR /&gt; if (action.form_style == "primary")&lt;BR /&gt; return "btn-primary";&lt;BR /&gt; &lt;BR /&gt; return "btn-default";&lt;BR /&gt; };&lt;BR /&gt; &lt;BR /&gt; $scope.getUIActions = function(type) {&lt;BR /&gt; if ($scope.data.disableUIActions)&lt;BR /&gt; return [];&lt;BR /&gt; if (type) {&lt;BR /&gt; return $scope.data.f._ui_actions.filter(function(action) {&lt;BR /&gt; //We handle the primary action button separately.&lt;BR /&gt; return !action.primary &amp;amp;&amp;amp; action['is_' + type];&lt;BR /&gt; });&lt;BR /&gt; } else {&lt;BR /&gt; return $scope.data.f._ui_actions;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;$scope.getPrimaryAction = function() {&lt;BR /&gt; var primaryActions = $scope.data.f._ui_actions.filter(function(action) {&lt;BR /&gt; return action.primary;&lt;BR /&gt; }); &lt;BR /&gt; return (primaryActions.length) ? primaryActions[0] : null;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;$scope.getUIActionContextMenu = function(event) {&lt;BR /&gt; var menu = [];&lt;BR /&gt; if (event.ctrlKey)&lt;BR /&gt; return menu;&lt;/P&gt;
&lt;P&gt;var contextActions = $scope.getUIActions('context');&lt;BR /&gt; contextActions.forEach(function(action) {&lt;BR /&gt; menu.push([action.name, function() {&lt;BR /&gt; $scope.triggerUIAction(action);&lt;BR /&gt; }]);&lt;BR /&gt; });&lt;/P&gt;
&lt;P&gt;if (contextActions.length &amp;gt; 0)&lt;BR /&gt; menu.push(null);&lt;BR /&gt; menu.push([$scope.data.exportPDFMsg, function() {&lt;BR /&gt; exportPDF("");&lt;BR /&gt; }]);&lt;BR /&gt; menu.push([$scope.data.exportPDFLandMsg, function() {&lt;BR /&gt; exportPDF('true');&lt;BR /&gt; }]);&lt;/P&gt;
&lt;P&gt;return menu;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;function exportPDF(landscape) {&lt;BR /&gt; $window.open("/" + $scope.data.f.table + ".do?PDF&amp;amp;landscape=" + landscape + "&amp;amp;sys_id=" + $scope.data.sys_id + "&amp;amp;sysparm_view=" + $scope.data.f.view);&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;//trigger the primary UI Action on save (if there is one)&lt;BR /&gt; var deregister = $scope.$on('$sp.save', function() {&lt;BR /&gt; var primaryAction = $scope.getPrimaryAction();&lt;BR /&gt; &lt;BR /&gt; if (primaryAction)&lt;BR /&gt; $scope.triggerUIAction(primaryAction);&lt;BR /&gt; });&lt;BR /&gt; $scope.$on('$destroy', function() {&lt;BR /&gt; deregister()&lt;BR /&gt; });&lt;/P&gt;
&lt;P&gt;$scope.triggerUIAction = function(action) {&lt;BR /&gt; if ($scope.data.disableUIActions &amp;amp;&amp;amp; !action.primary) {&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;var activeElement = document.activeElement;&lt;BR /&gt; if (activeElement) {&lt;BR /&gt; activeElement.blur();&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;$scope.$evalAsync(function() {&lt;BR /&gt; if (g_form) {&lt;BR /&gt; $scope.submitting = true;&lt;BR /&gt; if (!g_form.submit(action.action_name || action.sys_id))&lt;BR /&gt; $scope.submitting = false;&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;$scope.$on("spModel.uiActionComplete", function(evt, response, savedFormSysId) {&lt;BR /&gt; if (!response.isInsert &amp;amp;&amp;amp; ($scope.data.sys_id !== savedFormSysId))&lt;BR /&gt; return;&lt;/P&gt;
&lt;P&gt;$scope.submitting = false;&lt;BR /&gt; if (response.isActionAborted)&lt;BR /&gt; return;&lt;/P&gt;
&lt;P&gt;var sysID = (response.isInsert) ? response.sys_id : $scope.data.sys_id;&lt;BR /&gt; loadForm($scope.data.table, sysID).then(constructResponseHandler(response));&lt;BR /&gt; });&lt;/P&gt;
&lt;P&gt;function constructResponseHandler(response) {&lt;BR /&gt; return function() {&lt;BR /&gt; $rootScope.$broadcast("sp.form.submitted", {sys_id: (response.isInsert) ? response.sys_id : $scope.data.sys_id});&lt;BR /&gt; var message;&lt;BR /&gt; var eventName = "sp.form.record.updated";&lt;BR /&gt; if (response.isInsert) {&lt;BR /&gt; message = $scope.data.recordAddedMsg;&lt;BR /&gt; var search = $location.search();&lt;BR /&gt; search.sys_id = response.sys_id;&lt;BR /&gt; search.spa = 1;&lt;BR /&gt; $location.search(search).replace();&lt;BR /&gt; } else&lt;BR /&gt; message = $scope.data.updatedMsg;&lt;/P&gt;
&lt;P&gt;$scope.data.hideRelatedLists = hideRelatedLists();&lt;BR /&gt; $scope.$emit(eventName, $scope.data.f._fields, $scope.data.sys_id);&lt;BR /&gt; $rootScope.$broadcast(eventName, $scope.data.f._fields, $scope.data.sys_id);&lt;BR /&gt; $scope.status = message;&lt;BR /&gt; spUtil.addTrivialMessage(message);&lt;BR /&gt; spUtil.simulateFakeFormSubmitForAutoComplete('widget-form', $scope.data.f._fields);&lt;BR /&gt; $timeout(clearStatus, 2000);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;var ctrl = this;&lt;BR /&gt; // switch forms&lt;BR /&gt; var unregister = $scope.$on('$sp.list.click', onListClick);&lt;BR /&gt; $scope.$on("$destroy", function() {&lt;BR /&gt; unregister();&lt;BR /&gt; })&lt;BR /&gt; &lt;BR /&gt; function _save() {&lt;BR /&gt; var primaryAction = $scope.getPrimaryAction();&lt;BR /&gt; if (primaryAction)&lt;BR /&gt; $scope.triggerUIAction(primaryAction);&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; function onListClick(evt, arg) {&lt;BR /&gt; loadForm(arg.table, arg.sys_id);&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;function loadForm(table, sys_id) {&lt;BR /&gt; var f = {};&lt;BR /&gt; $scope.data.table = f.table = table;&lt;BR /&gt; $scope.data.sys_id = f.sys_id = sys_id;&lt;BR /&gt; f.view = $scope.data.view;&lt;BR /&gt; return $scope.server.update().then(setupAttachmentHandler);&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;function openRelatedList(e, queryString) {&lt;BR /&gt; // todo: Open this in a modal&lt;BR /&gt; $location.search(queryString);&lt;BR /&gt; e.preventDefault();&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;$scope.$on('spModel.fields.rendered', function() {&lt;BR /&gt; if (ctrl.panels)&lt;BR /&gt; ctrl.panels.removeClass('shift-out').addClass('shift-in');&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; var g_form;&lt;BR /&gt; function initForm(gFormInstance) {&lt;BR /&gt; $scope.$evalAsync(function() {&lt;BR /&gt; if ($('#widget-form').parents('.modal').length)&lt;BR /&gt; $scope.embeddedInModal = true;&lt;BR /&gt; })&lt;/P&gt;
&lt;P&gt;if (gFormInstance.getTableName() == $scope.data.f.table){&lt;BR /&gt; g_form = gFormInstance;&lt;BR /&gt; spNavStateManager.register($scope.data.table, _save, g_form);&lt;BR /&gt; $scope.isPageReady = true;&lt;BR /&gt; $timeout(function() {&lt;BR /&gt; $rootScope.$emit('spModel.gForm.rendered', g_form);&lt;BR /&gt; }, 175);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; $scope.$on('spModel.gForm.initialized', function(e, gFormInstance) {&lt;BR /&gt; initForm(gFormInstance);&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; $scope.$on('spModel.gForm.env.created', function(e, gFormInstance) {&lt;BR /&gt; initForm(gFormInstance);&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; // update the comments or worknotes based on activity stream&lt;BR /&gt; $scope.$on("activity_stream_is_changed", function(event, data) {&lt;BR /&gt; if (g_form &amp;amp;&amp;amp; g_form.hasField(data.fieldName)) {&lt;BR /&gt; g_form.setValue(data.fieldName, data.input);&lt;BR /&gt; if (data.fieldToClear != "" &amp;amp;&amp;amp; g_form.hasField(data.fieldToClear))&lt;BR /&gt; g_form.setValue(data.fieldToClear, "");&lt;BR /&gt; }&lt;BR /&gt; })&lt;/P&gt;
&lt;P&gt;// Show or hide related lists&lt;BR /&gt; $scope.$watch('data.f._related_lists', function() {&lt;BR /&gt; $scope.data.hideRelatedLists = hideRelatedLists();&lt;BR /&gt; }, true);&lt;BR /&gt; &lt;BR /&gt; $scope.hideDuplicateSaveAction = function (item) {&lt;BR /&gt; if (!$scope.data.advancedUIEnabled)&lt;BR /&gt; return true;&lt;BR /&gt; return ($scope.data.advancedUIEnabled &amp;amp;&amp;amp; item.sys_id !== "432ace8b0a0a0b34006b02832660c894" &amp;amp;&amp;amp; item.sys_id !== "42e780d40a0a0b34007e0d4a52d33405");&lt;BR /&gt; };&lt;/P&gt;
&lt;P&gt;function hideRelatedLists() {&lt;BR /&gt; if (!$scope.data.f._related_lists)&lt;BR /&gt; return true;&lt;/P&gt;
&lt;P&gt;if ($scope.options.hideRelatedLists == true)&lt;BR /&gt; return true;&lt;/P&gt;
&lt;P&gt;if ($scope.data.sys_id == '-1')&lt;BR /&gt; return true;&lt;/P&gt;
&lt;P&gt;// If all related lists are visible=false then hide&lt;BR /&gt; if ($scope.data.f._related_lists.length &amp;gt; 0) {&lt;BR /&gt; for (var i in $scope.data.f._related_lists) {&lt;BR /&gt; var list = $scope.data.f._related_lists[i];&lt;BR /&gt; if (list.visible) {&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; return true;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;function clearStatus() {&lt;BR /&gt; $scope.status = "";&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;function setupAttachmentHandler() {&lt;BR /&gt; $scope.attachmentHandler = new nowAttachmentHandler(appendDone, appendError);&lt;/P&gt;
&lt;P&gt;$scope.$evalAsync(function() {&lt;BR /&gt; $scope.attachmentHandler.setParams($scope.data.table, $scope.data.f._attachmentGUID, 1024 * 1024 * $scope.data.maxAttachmentSize);&lt;BR /&gt; });&lt;/P&gt;
&lt;P&gt;$scope.$on('dialog.upload_too_large.show', function(e) {&lt;BR /&gt; $log.error($scope.data.largeAttachmentMsg);&lt;BR /&gt; spUtil.addErrorMessage($scope.data.largeAttachmentMsg);&lt;BR /&gt; });&lt;BR /&gt; }&lt;BR /&gt; setupAttachmentHandler();&lt;/P&gt;
&lt;P&gt;function appendDone() {&lt;BR /&gt; // don't know here whether upload succeeded, so can't show msg either way&lt;BR /&gt; $scope.$broadcast("sp.attachments.update", $scope.data.f._attachmentGUID);&lt;BR /&gt; spUtil.retrieveSessionMessages();&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;function appendError(error) {&lt;BR /&gt; $scope.errorMessages.push(error);&lt;BR /&gt; spUtil.addErrorMessage(error.msg + error.fileName);&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;if ($scope.data.f.title) {&lt;BR /&gt; $scope.$emit('sp.widget-modal.set-aria-label', $scope.data.f.title);&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Link Function:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;function(){&lt;BR /&gt; setTimeout(function(){&lt;BR /&gt; $('#adminMenu, #platformLink').tooltip();&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Options Schema:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;[{"name":"disableUIActions","section":"Behavior","label":"Disable UI Actions on Form","type":"boolean"},{"name":"showFormView","section":"Behavior","label":"Display current form view","type":"boolean"},{"name":"omitHeaderOptions","section":"Behavior","label":"Omit header options icon","type":"boolean"}]&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 16:28:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/user-is-not-able-to-create-new-notification-channel-from-table/m-p/463321#M35100</guid>
      <dc:creator>Ajay Sharma2</dc:creator>
      <dc:date>2022-02-10T16:28:59Z</dc:date>
    </item>
  </channel>
</rss>

