You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Issue in Calling OIC Integration using Page Composer

edited Nov 28, 2024 9:46AM in ERP Integrations 2 comments

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;

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!