<?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 NEW UI Action button in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2977188#M374</link>
    <description>&lt;P&gt;&lt;A class="" href="https://www.servicenow.com/community/forums/searchpage/tab/message?advanced=false&amp;amp;allow_punctuation=false&amp;amp;filter=location&amp;amp;location=forum-board%3Adeveloper-forum&amp;amp;q=there+is+a+related+list+in+the+incident+form+named+incident+task+when+you+click+on+the+button+new+the+incident+number+of+this+form+gets+auto+populated+in+the+incident+field+i+want+a+script+to+be+written+in+ui+action+button+such+that+whenever+i+click+that+the+number+of+that+same+incident+form+should+also+get+populated+in+the+parent+field+in+the+incident+task+form+the+approach+must+not+be+business+rule&amp;amp;q=there+is+a+related+list+in+the+incident+form+named+incident+task+when+you+click+on+the+button+new+the+incident+number+of+this+form+gets+auto+populated+in+the+incident+field+i+want+a+script+to+be+written+in+ui+action+button+such+that+whenever+i+click+that+the+number+of+that+same+incident+form+should+also+get+populated+in+the+parent+field+in+the+incident+task+form+the+approach+must+not+be+business+rule&amp;amp;nospellcheck=true" target="_blank" rel="nofollow noopener"&gt;there is a related list in the incident form named incident task when you click on the button new the incident number of this form gets auto populated in the incident field i want a script to be written in ui action button such that whenever i click that the number of that same incident form should also get populated in the parent field in the incident task form the approach must not be business rule&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2024 12:44:37 GMT</pubDate>
    <dc:creator>Aishwarya3017</dc:creator>
    <dc:date>2024-07-01T12:44:37Z</dc:date>
    <item>
      <title>NEW UI Action button</title>
      <link>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2977188#M374</link>
      <description>&lt;P&gt;&lt;A class="" href="https://www.servicenow.com/community/forums/searchpage/tab/message?advanced=false&amp;amp;allow_punctuation=false&amp;amp;filter=location&amp;amp;location=forum-board%3Adeveloper-forum&amp;amp;q=there+is+a+related+list+in+the+incident+form+named+incident+task+when+you+click+on+the+button+new+the+incident+number+of+this+form+gets+auto+populated+in+the+incident+field+i+want+a+script+to+be+written+in+ui+action+button+such+that+whenever+i+click+that+the+number+of+that+same+incident+form+should+also+get+populated+in+the+parent+field+in+the+incident+task+form+the+approach+must+not+be+business+rule&amp;amp;q=there+is+a+related+list+in+the+incident+form+named+incident+task+when+you+click+on+the+button+new+the+incident+number+of+this+form+gets+auto+populated+in+the+incident+field+i+want+a+script+to+be+written+in+ui+action+button+such+that+whenever+i+click+that+the+number+of+that+same+incident+form+should+also+get+populated+in+the+parent+field+in+the+incident+task+form+the+approach+must+not+be+business+rule&amp;amp;nospellcheck=true" target="_blank" rel="nofollow noopener"&gt;there is a related list in the incident form named incident task when you click on the button new the incident number of this form gets auto populated in the incident field i want a script to be written in ui action button such that whenever i click that the number of that same incident form should also get populated in the parent field in the incident task form the approach must not be business rule&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 12:44:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2977188#M374</guid>
      <dc:creator>Aishwarya3017</dc:creator>
      <dc:date>2024-07-01T12:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: NEW UI Action button</title>
      <link>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2977320#M375</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/616651"&gt;@Aishwarya3017&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Create a UI action in ServiceNow that will populate the parent field in the Incident Task form when a new Incident Task is created from an Incident form using below script:&lt;BR /&gt;&lt;BR /&gt;// Set the properties of the UI Action&lt;BR /&gt;name: "Create Incident Task with Parent",&lt;BR /&gt;table: "incident",&lt;BR /&gt;action name: "new_incident_task",&lt;BR /&gt;show insert: true,&lt;BR /&gt;show update: false,&lt;BR /&gt;show on form: true,&lt;BR /&gt;form button: true,&lt;BR /&gt;client: true,&lt;BR /&gt;client script: true,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Client-side script
function createIncidentTaskWithParent() {
    var incidentSysId = g_form.getUniqueValue(); // Get the Sys ID of the current incident record
    var incidentNumber = g_form.getValue('number'); // Get the incident number
    
    // Open a new Incident Task form and populate the 'parent' and 'incident' fields
    var url = '/nav_to.do?uri=incident_task.do?sys_id=-1&amp;amp;sysparm_query=incident=' + incidentSysId + '^parent=' + incidentSysId;
    window.open(url, '_blank'); // Open the form in a new tab or window
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;STRONG&gt;If my solution helps you any way then mark it as accepted and helpful.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Thank You!!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 14:00:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2977320#M375</guid>
      <dc:creator>Dnyaneshwaree</dc:creator>
      <dc:date>2024-07-01T14:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: NEW UI Action button</title>
      <link>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2977923#M376</link>
      <description>&lt;P&gt;I dont want a new button actually i need to modify the existing Ui Action named New button in the incident task related list of the incident form.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 05:27:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2977923#M376</guid>
      <dc:creator>Aishwarya3017</dc:creator>
      <dc:date>2024-07-02T05:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: NEW UI Action button</title>
      <link>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2978407#M377</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/616651"&gt;@Aishwarya3017&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Okay, Try this updated code ones:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var uri = action.getGlideURI();
var path = uri.getFileFromPath() + '';
path = path.substring(0, path.length - 5) + '.do';

// Retrieve the incident number from the current form
var incidentNumber = g_form.getValue('number');

// Add the incident number to the URI as a parameter
uri.set('sys_id', '-1');
uri.set('sysparm_query', 'incident.number=' + incidentNumber);

// Check for wizard and redirect URL
path = checkWizard(uri, path);

if (path) {
    action.setRedirectURL(uri.toString(path));
}

action.setNoPop(true);

function checkWizard(uri, path) {
    var already = uri.get('WIZARD:action');
    if (already == 'follow')
        return null;

    var wizID = new GlideappWizardIntercept(path).get();
    if (!wizID)
        return path;

    uri.set('sysparm_parent', wizID);
    uri.deleteParmameter('sysparm_referring_url');
    uri.deleteMatchingParameter('sysparm_list_');
    uri.deleteMatchingParameter('sysparm_record_');
    uri.deleteParmameter('sys_is_list');
    uri.deleteParmameter('sys_is_related_list');
    uri.deleteParmameter('sys_submitted');
    uri.deleteParmameter('sysparm_checked_items');
    uri.deleteParmameter('sysparm_ref_list_query');
    uri.deleteParmameter('sysparm_current_row');

    uri.set('sysparm_referring_url', uri.toString());
    uri.deleteMatchingParameter('fancy.');
    uri.deleteMatchingParameter('sys_rownum');
    uri.deleteMatchingParameter('sysparm_encoded');
    uri.deleteMatchingParameter('sysparm_query_encoded');
    uri.deleteParmameter('sysparm_refer');

    return 'wizard_view.do';
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;If my solution helps you any way then mark it as accepted and helpful.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Thank You!!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 12:37:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/new-ui-action-button/m-p/2978407#M377</guid>
      <dc:creator>Dnyaneshwaree</dc:creator>
      <dc:date>2024-07-02T12:37:20Z</dc:date>
    </item>
  </channel>
</rss>

