Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2021-02-03 10:07 AM
Hi all,
Can someone assist me in the following issue:
I have two datafeeds running through two custom object buttons in the same page.
As it seems the system runs always the second one (if you put a second)
I attach the code for feed 1 and feed 2 - if someone can spot the issue...
2021-02-05 11:37 AM
Alexandors, change the datafeedGUID variable to be unique for each button for the feeds. When you add the second data feed button it replaces the data feed GUID from the first data feed button
Advisory Consultant
2021-02-05 11:37 AM
Alexandors, change the datafeedGUID variable to be unique for each button for the feeds. When you add the second data feed button it replaces the data feed GUID from the first data feed button
Advisory Consultant
2021-02-05 02:08 PM
Hi David,
I have put them in different tabs and they work fine...
But your solution seems to be safest - will try it now and update here
One more question: could somehow share some code for having an update through some button or to a field for the successful completion of the feed(s)s?
Thanx in advance -
Alexandros
2021-02-09 03:18 PM
Alexandors, you can add this function to poll the feed status, update the success if statements to perform any action you need. In your .ajax success call this function.
function pollDataFeedStatus(){
$.ajax({
type: "POST",
url: baseURL+'/api/core/datafeed/history/recent',
headers: {
'x-csrf-token': (window.sessionStorage) ? window.sessionStorage.getItem("x-csrf-token") : parent.parent.ArcherApp.globals['xCsrfToken'],
'X-Http-Method-Override' :'GET'
},
data: JSON.stringify({"Guid": datafeedGUID}),
contentType: 'application/json',
processData: false,
dataType: 'json',
success: function(data) {
var status = data.RequestedObject.Status;
if(status == 1 || status == 7) {
// Feed Running or Pending
// Continue checking feed status
setTimeout(pollDataFeedStatus,5000)
} else if (status == 2 || status == 4) {
// Feed Completed or Warning
} else {
// Feed Faulted, Terminating or Terminated
}
},
error: function() {
// Error occurred
}
});
}
Advisory Consultant