- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 04:18 PM
Hi everyone,
When clicking on the table row, the user will be directed to a form,
but this form must be on the same page without having to load it.
Obs.: Before the user was clicking on the record and being directed to another page,
due to this I am using the “sys_id” of the page.
I have to use "$location.search", but its not working:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 07:58 PM
@Elton2 Tried and Tested solution.
Please try below code:
Server:
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2022 05:22 AM
@Elton2 We can open in same tab also as follows
$window.open(url, c.options.target);
Change the above line to
$window.open(url, "_self);
OR
In the instance options you should have a target field there, select _self there.
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 07:58 PM
@Elton2 Tried and Tested solution.
Please try below code:
Server:
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 11:31 AM - edited 12-08-2022 11:33 AM
Hi @jaheerhattiwale how are you?!
When the user clicks on the Record in the table, user is directed. This URL is created:
new_portal?id=widget_of_new_form&table=kb_all_item&view=WidgetNew
However, the Sys_id of the Registry does not appear in the URL and the order is not correct,
I believe that because that does not create the "object" and also does not direct to the Form page, if direct to page
it would be good too.
for exemplo: data.formPage = $sp.getParameter('id') == 'new_portal_register_form';
/*CLIENT SCRIPT*/
c.goToRecord = function(recordId){
var parms = {
id: 'widget_of_new_form',
table: c.data.table,
view: c.data.view,
sys_id: recordId,
};
$location.search(parms);
};
Tks again for you support!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 06:52 PM
@Elton2 Can you please post the screen shots of HTML, Client Script and Server script code?
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2022 05:18 AM
Hi @jaheerhattiwale , how are you?
I believe you are on the right path, but according to your tips the form does not render on the same page of the Table and the records do not appear.
I have attached pictures
Tks again!!