@ChrisPiasecki Thank you for the high-level solution. I was trying to get the Main Grid context and associated FetchXML using the below code but it doesn't work. I am passing "SelectedControl" from the Main Grid Command bar's new Custom Button.
function ExportWithLogos(gridContext){
var grid = gridContext.getGrid();
var fetchXMLStr = gridContext.getFetchXML();
console.log(fetchXMLStr);
var myHeaders = new Headers();
myHeaders.append("Content-Type","application/json")
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: fetchXMLStr
};
fetch("https://prod-05.westeurope.logic.azure.com:443/workflows/488c31d7faf044f6922ab3b6c0c1e456/triggers/manual/paths/invoke?api-version=2016-06-01", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
}
Below is the error I get
app.3e7136f1ee0fd09a7329c8ed6b14ab80.js:14 Uncaught (in promise) TypeError: gridContext.getFetchXML is not a function
at ExportWithLogos (tms_ExportWithLogos:3:35)
at y._executeFunctionInternal (app.3e7136f1ee0fd09a7329c8ed6b14ab80.js:14:1194896)
at y.execute (app.3e7136f1ee0fd09a7329c8ed6b14ab80.js:14:1193330)
at 12.7a4539ab78f9b42326a33d062838c305.js:4:40950
at i (app.3e7136f1ee0fd09a7329c8ed6b14ab80.js:14:99256)
at 12.7a4539ab78f9b42326a33d062838c305.js:4:40940
at Array.map (<anonymous>)
at 12.7a4539ab78f9b42326a33d062838c305.js:4:39917