Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2019-09-04 02:27 PM
Hello Everyone,
I have included the below custom code to open a particular record of a cross reference field based on the user logon name, however while closing the record (child record) I'm receiving the error (see the attached doc) - parent page loaded without css
Could you all look into this and advise? Appreciate your help in advance.
function getMatchingElements(){
var loggedInUser = parent.ArcherApp.globals.displayName;
var table = $('table[id *="21713srvgrid"] tbody');
var count = 1;
var str = '';
var matchingRows =[];
table.find('tr').each(function (i) {
var $tds = $(this).find('td'),
trackingId= $tds.eq(0).find('a').text(),
country = $tds.eq(1).find('span').text(),
businessArea =$tds.eq(2).find('span').text() ,
controlGroup = $tds.eq(3).find('span').text(),
signatory = $tds.eq(5).find('a').text();
if(signatory === loggedInUser){
str += count + "."+trackingId + "--";
str += country + "--";
str += businessArea + "--";
str += controlGroup + "\n";
count++;
matchingRows.push(i);
}
});
if(matchingRows.length > 1){
var response = prompt('You have '+ matchingRows.length + ' matching records waiting for approval. Please select one. '+ str + "Enter your selection.");
if(response){
var tr = table.find('tr')[matchingRows[(parseInt(response) -1)]];
debugger;
tr.children[0].children[0].click();
}
}
else if(matchingRows.length === 1){
var selectedRow = table.find('tr')[matchingRows[0]];
debugger;
var anchorElementTd = selectedRow.children[0].children[0];
var href = anchorElementTd.href;
//window.location(href);
var value = href.split("('")[1].split("|'")[0];
$pbC(value);
}
}
2019-09-04 05:50 PM
Hello Babu,
Could you please attach the screenshot with proper styling . it would be easy to understand your requirement.
And you can open the link (#href ) in a new tab then no worry to close it ? will that work?
2019-09-05 12:42 PM