Adding addition tabindex option to open in New tab from list view portal

DB1
Tera Contributor

Hello All,

I have a cloned widge of Copy Data Instance from table "Instance with Table [sp_instance_table]" and is there a way that open in new tab could be added along with "show matching" etc

DB1_0-1669291800736.png

 

@Ankur Bawiskar @Mark Roethof @Community Alums @Mohith Devatte @Anil Lande @Jaspal Singh 

Open in New tab or ctrl option from Portal list view

Please advise 

Also, is there a way to change the backend/help text of the search from "Keyword Search" to something else?

 

I am looking for options to open any Incident record in a new window when selected from the data table cloned widget

 

Thanks,

DB

3 ACCEPTED SOLUTIONS

@DB1 Did the solution solve your problem? 

So my code  would have created a new button and when you click on the button it opens the record in new window

 

if not let me know if you need any alternative

 

If this solved the issue can you please mark the answer correct and close the thread so that it will be helpful for others in future?

View solution in original post

@DB1 but i can see the OOB code is this in my PDI .Did you change any code ?

just replace your widget id in the last line instead of test

 

(function(){
	/*  "use strict"; - linter issues */
	// populate the 'data' object
	var sp_page = $sp.getValue('sp_page');
	var pageGR = new GlideRecord('sp_page');
	pageGR.get(sp_page);
	data.page_id = pageGR.getValue("id");
	$sp.getValues(data);
	if (data.field_list) {
		data.fields_array = data.field_list.split(',');
	} else {
		data.field_list = $sp.getListColumns(data.table);
	}

	if (input) {
		data.p = input.p;
		data.o = input.o;
		data.d = input.d;
		data.q = input.q;
	}
	data.p = data.p || 1;
	data.o = data.o || $sp.getValue('order_by');
	data.d = data.d || $sp.getValue('order_direction');

	data.page_index = (data.p - 1);
	data.window_size = $sp.getValue('maximum_entries') || 10;
	data.window_start  = (data.page_index * data.window_size);
	data.window_end = (((data.page_index + 1) * data.window_size));
	data.filter = $sp.getValue("filter");

	var gr = new GlideRecordSecure(data.table);
	if (!gr.isValid()) {
		data.invalid_table = true;
		data.table_label = data.table;
		return;
	}
	data.table_label = gr.getLabel();

	options.table = data.table;
	options.fields = data.field_list;
	options.o=data.o;
	options.d= data.d;
	options.filter=data.filter;
	options.window_size=data.window_size;
	options.view = data.view;
	options.useInstanceTitle = true; // to make sure Data Table widget uses headerTitle always
	options.headerTitle = options.title;
	options.show_breadcrumbs=true;
	options.enable_filter=true;
	data.dataTableWidget = $sp.getWidget('test', options);
})();

 

 

View solution in original post

@DB1 Sure in the client controller i handled the redirection part in this below function at the top of your client controller script find it and replace it with below code 

c.openRecord=function(id)
{
window.open("/sp?id=ticket&table="+c.data.table+"&sys_id="+id ,"_blank");

}

 

Hope this helps 

Accept this solution if it helped you 

Thanks

View solution in original post

24 REPLIES 24

@DB1 but i can see the OOB code is this in my PDI .Did you change any code ?

just replace your widget id in the last line instead of test

 

(function(){
	/*  "use strict"; - linter issues */
	// populate the 'data' object
	var sp_page = $sp.getValue('sp_page');
	var pageGR = new GlideRecord('sp_page');
	pageGR.get(sp_page);
	data.page_id = pageGR.getValue("id");
	$sp.getValues(data);
	if (data.field_list) {
		data.fields_array = data.field_list.split(',');
	} else {
		data.field_list = $sp.getListColumns(data.table);
	}

	if (input) {
		data.p = input.p;
		data.o = input.o;
		data.d = input.d;
		data.q = input.q;
	}
	data.p = data.p || 1;
	data.o = data.o || $sp.getValue('order_by');
	data.d = data.d || $sp.getValue('order_direction');

	data.page_index = (data.p - 1);
	data.window_size = $sp.getValue('maximum_entries') || 10;
	data.window_start  = (data.page_index * data.window_size);
	data.window_end = (((data.page_index + 1) * data.window_size));
	data.filter = $sp.getValue("filter");

	var gr = new GlideRecordSecure(data.table);
	if (!gr.isValid()) {
		data.invalid_table = true;
		data.table_label = data.table;
		return;
	}
	data.table_label = gr.getLabel();

	options.table = data.table;
	options.fields = data.field_list;
	options.o=data.o;
	options.d= data.d;
	options.filter=data.filter;
	options.window_size=data.window_size;
	options.view = data.view;
	options.useInstanceTitle = true; // to make sure Data Table widget uses headerTitle always
	options.headerTitle = options.title;
	options.show_breadcrumbs=true;
	options.enable_filter=true;
	data.dataTableWidget = $sp.getWidget('test', options);
})();

 

 

Thank you so much!

Can you please help on the last one from this please.

While redirection to this url - sp?id=form&table=incident&sys_id=dbc9b67b1b8b1910a6706286764bcb48

from the inner widget for "Open rECORD" button I would want it to ridirect to something like this

to a custom page

sp?id=ticket&table=incident&sys_id=dbc9b67b1b8b1910a6706286764bcb48&view=sp

how to achieve the same?

Thanks

@DB1 Sure in the client controller i handled the redirection part in this below function at the top of your client controller script find it and replace it with below code 

c.openRecord=function(id)
{
window.open("/sp?id=ticket&table="+c.data.table+"&sys_id="+id ,"_blank");

}

 

Hope this helps 

Accept this solution if it helped you 

Thanks

DB1
Tera Contributor

@Mohith Devatte One last mohith sorry I am troubling too much on this. I don't know portal much.

When Open Record button is selected it is redirecting us to this page = sp?id=form&table=incident&sys_id=6132a1a49727d95020e9babcd153afb3

But how to open it using a custom page I already have?