<?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: Redirect user to a different url using Business rule in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978821#M1127096</link>
    <description>&lt;P&gt;I think you may need to full URL. Can you try below&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;var url = gs.generateURL('sys_attachment', gr.sys_id);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;gs.setRedirect(url);&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2024 18:19:49 GMT</pubDate>
    <dc:creator>SanjivMeher</dc:creator>
    <dc:date>2024-07-02T18:19:49Z</dc:date>
    <item>
      <title>Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978805#M1127088</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Im trying to redirect user using onAfter Business rule but I had no luck, what am I doing wrong?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var gr = new GlideRecord('sys_attachment');
	gr.addEncodedQuery('table_sys_id='+current.getUniqueValue());
	gr.query();
	if(gr.next()){
		gs.log('zhahgaha');
		gs.setRedirect('/sys_attachment.do?sys_id=2522a51393c30210b73aba7efaba105a');
	}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:10:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978805#M1127088</guid>
      <dc:creator>Alon Grod</dc:creator>
      <dc:date>2024-07-02T18:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978811#M1127092</link>
      <description>&lt;P&gt;Hi Alon,&lt;/P&gt;
&lt;P&gt;Can you try replacing&lt;/P&gt;
&lt;P&gt;gs.setRedirect() with action.setRedirectURL('/sys_attachment.do?sys_id=2522a51393c30210b73aba7efaba105a')&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:13:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978811#M1127092</guid>
      <dc:creator>Jaspal Singh</dc:creator>
      <dc:date>2024-07-02T18:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978818#M1127094</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/257473"&gt;@Jaspal Singh&lt;/a&gt;&amp;nbsp;i tried its not working&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:17:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978818#M1127094</guid>
      <dc:creator>Alon Grod</dc:creator>
      <dc:date>2024-07-02T18:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978821#M1127096</link>
      <description>&lt;P&gt;I think you may need to full URL. Can you try below&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;var url = gs.generateURL('sys_attachment', gr.sys_id);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;gs.setRedirect(url);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:19:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978821#M1127096</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2024-07-02T18:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978832#M1127102</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/433193"&gt;@SanjivMeher&lt;/a&gt;&amp;nbsp;still not working&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:23:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978832#M1127102</guid>
      <dc:creator>Alon Grod</dc:creator>
      <dc:date>2024-07-02T18:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978838#M1127105</link>
      <description>&lt;P&gt;Can you provide the full script you have now after making the changes?&lt;/P&gt;
&lt;P&gt;Can you add a gs.addInfoMessage to check whats going on?&lt;/P&gt;
&lt;P&gt;Do you have attachment in the attachment table in that record?&lt;/P&gt;
&lt;P&gt;Also can you provide the use case you want to achieve? Non-admin users mayn't have access to the sys_attachment table.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:26:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978838#M1127105</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2024-07-02T18:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978843#M1127107</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/433193"&gt;@SanjivMeher&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Im admin. Im getting the log so it means that I have an attachment.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var gr = new GlideRecord('sys_attachment');
    gr.addEncodedQuery('table_sys_id=' + current.getUniqueValue());
    gr.query();
    if (gr.next()) {

		gs.log('zzzzza');
        var url = gs.generateURL('sys_attachment', gr.sys_id);

        gs.setRedirect(url);
    }&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:28:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978843#M1127107</guid>
      <dc:creator>Alon Grod</dc:creator>
      <dc:date>2024-07-02T18:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978851#M1127111</link>
      <description>&lt;P&gt;Do you have option to use a UI action instead?&lt;/P&gt;
&lt;P&gt;Is there a separate button you are clicking other than Save to trigger this?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:36:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978851#M1127111</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2024-07-02T18:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect user to a different url using Business rule</title>
      <link>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978853#M1127113</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/433193"&gt;@SanjivMeher&lt;/a&gt;&amp;nbsp;Unfortunately i hvae to use Business Rule. Yes, I just change the state to completed and that is trigger the BR to work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:39:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/redirect-user-to-a-different-url-using-business-rule/m-p/2978853#M1127113</guid>
      <dc:creator>Alon Grod</dc:creator>
      <dc:date>2024-07-02T18:39:58Z</dc:date>
    </item>
  </channel>
</rss>

