Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Custom Objects on same layout to run data feeds aren't working

galendar_aws
Contributor

Hello All,

I've multiple Custom Objects on same layout to run data feeds and only one works. Each of the custom object is configured to run a different data feed. Below is the sample code for one of the custom object. Another issue with the same custom objects id that users without sysadmin access can't trigger the data feeds using the same buttons. Any help with both the issues is highly appreciated. Thank you.

<!DOCTYPE html>
<html>
<head>
<style>
#ropa-btn-generate1 {
background-color: transparent;
margin: 1% 0% 1% 7%;
}
#ropaMsgDspl1{
color:#555;
border-radius:10px;
font-family: Tahoma;font-size:14px;
padding:10px 10px 10px 36px;
position: fixed;
top: 0;
left: 0;
height: 1em;
width: 100%;
background-color: #e9ffd9;
z-index: 999;
font-weight:bold;
}
</style>
</head>
<body>
<div id="ropa-toolbar-app-buttons1">
<a id="ropa-btn-capture1" href="javascript&colon;void(0);" data-check-dirty="false">
<div id="ropa-btn-generate1" class="tb-btn" data-icon="&#xE08F" data-icon-pos="left" onclick="ropa_executedatafeed();"> Generate ARLs </div>
</a>
</div>
<div id="ropaMsgDspl1" style="display:none"><span>SUCCESS: </span>Generating ARLs.</div>
</body>
</html>

<script type="text/javascript">

var datafeedGUID = '032C56CB-2C06-4F6B-A55A-2DFA4057BF90';
//var baseURL = 'https://SERVERNAME/RSAarcher'; // Build the base URL from address bar
var restAPICall = {"DataFeedGuid":datafeedGUID, "IsReferenceFeedsIncluded":true};

Sys.Application.add_load( function() {
if (sessionStorage.getItem("status")==200) {
document.getElementById("ropaMsgDspl1").style.display = "block";
setTimeout( function(){document.getElementById("ropaMsgDspl1").style.display = "none";}, 10000);
sessionStorage.setItem("status", "100");
}

});

function ropa_executedatafeed(){
$.ajax({
type: "POST",
url: baseURL+'/api/core/datafeed/execution',
headers: {
'x-csrf-token': (window.sessionStorage) ? window.sessionStorage.getItem("x-csrf-token") : csrfToken = parent.parent.ArcherApp.globals['xCsrfToken']
},
data: JSON.stringify(restAPICall),
contentType: 'application/json',
processData: false,
dataType: 'json',
success: function() {

sessionStorage.setItem("status", "200");
$('#master_btnApply').click();},

error: function() {alert("An unexpected error has occurred in the system. Please try your request again. If problems persist, please contact your system administrator")}
});
}

</script>

2 REPLIES 2

Anonymous
Not applicable

@galendar_aws,

Use triggering feed must have access to execute DataFeeds. So u need to tweak Access Role.

DavidPetty
Archer Employee
Archer Employee

@galendar_aws it sounds like you migh be using the same variable names for all the custom objects and that last varible that gets set is the one all the custom objects use.

Ideally you should have 1 custom object that handles it all.  Each button should pass the GUID of the data feed to the function that calls the data feed API.

 Advisory Consultant