Issue in Calling OIC Integration using Page Composer
Hi All,
We are trying to call OIC Integration via Custom Button on Purchase Order Object.We have used Page Composer to create HTML Component as Button and added HTML content with java script in it.We are observing that Integration is not being called on First click but works on subsequent clicks. Request your help in resolving this Issue.
HTML Content:
<html><script language="javascript">
var invocation = new XMLHttpRequest();
var url = 'ENDPOINT';
var authCode = 'DETAILS';
function callIntegration()
{
if(invocation)
{
invocation.open('POST', url, true);
invocation.setRequestHeader('Accept', 'application/json');
invocation.setRequestHeader('Content-Type', 'application/json');
invocation.setRequestHeader('Authorization',authCode);
invocation.onreadystatechange = stateChangeEventHandler;