URL is too large
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2023 02:38 AM
Hi All,
Can anyone please help us on the below issue.
We created one business rule to set one table records url in one URL type field called "Data Link" and when an user click on the url it will open new records list view in new tab.
But sometimes when we get more than 50 records url, after click on the url we're getting below error.
Please help us to complete this.
Advance thanks.
Error Image:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2023 02:19 AM - edited 01-09-2023 02:19 AM
Hi Ajay,
Many thanks for the response.
One the thread we saw to check the calculated checkbox as true and mention some javascript code
we tried the logic but it's not working and the url also not showing on field level.
Advance thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2023 03:41 AM
Can you share your script here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2023 04:04 AM
Hi Ajay,
Thanks for the response.
Please find the below BR script:
(function executeRule(current, previous /*null when async*/ ) {
setLink();
function setLink() {
gs.info("inside function");
var d = [];
var d1 = [];
var di=new GlideRecord('sec_cmn_src_ci');
di.addEncodedQuery('cmdb_ci.sys_class_name=cmdb_ci_firewall_device_cisco^last_scan_dateONLast 90 days@javascript:gs.beginningOfLast90Days()@javascript:gs.endOfLast90Days()^cmdb_ci.operational_status=1');
di.query();
while (di.next())
{
gs.info("inside first loop");
d.push(di.cmdb_ci.toString());
}
var ci = new GlideRecord("cmdb_ci");
ci.addEncodedQuery('sys_class_name=cmdb_ci_firewall_device_cisco^operational_status=1');
ci.addQuery('sys_id', 'NOT IN', d);
ci.query();
while (ci.next()) {
gs.info('inside second loop');
d1.push(ci.getValue("name"));
}
gs.info("d1 is" + d1);
for (var i = 0; i < d1.length; i++)
{
var url = gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + 'cmdb_ci' + '_list.do?sysparm_query=nameLIKE' + d1;
gs.info("link is" + url);
current.u_data_link = url;
}
}
})(current, previous);
Advance thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2023 03:40 AM - edited 01-10-2023 03:48 AM
If you are using calculated as true then you need to write this script in the calculated script and not in the business rule. But anyways this will behave the same as a URL field as you have created earlier. This is the reason I was suggesting to check for creating a hyperlink which is possible if you create a field as HTML type. And you can hide the toolbars with the below option:
Another solution which you can try is creating a string field as mentioned in below thread: