0 votes

Hi,
I am in local in efficy 11.2
I had the following error in the console when I want to press ok to add a widget in local.

Access to XMLHttpRequest at 'https://xxxx.efficytest.com/crm/widget?action=todayadd' from origin 'http://127.0.0.1:1026' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

then I changed my appBase in the custom.js

and now it shows me another error;

TWidgetRequestHandler - Required Argument not found: "ITEMS" 

at this in the Base.js: errorfunc(msg.replace(/"/g,'"'), det);

function IsNotEfficyErrorHtml(html, errorfunc) {
if (typeof errorfunc !== 'function') {
errorfunc = (typeof console === 'object' && typeof console.log === 'function') ? console.log.bind(console) : function () {};
}
var errPos = html.indexOf('<span id="error-message">');
var tagPos = html.indexOf('<!--ISEFFICYERROR-->'); // will be -1 if html is a memo where a user copied and pasted the error page, HTML comments do not get copied
if (errPos >= 0 && tagPos >= 0) {
var msg = html.substring(errPos + 25,html.indexOf('</span>', errPos + 25)); // = html.match(/<span id="ErrorMsg">((.|[\r\n])*)<\/span>/)[1] but IE has regex issues
var detPos = html.indexOf('<div id="Scrollbox">', errPos);
var det = (detPos >=0) ? html.substring(detPos + 20,html.indexOf('</div>', detPos + 20)).replace(/"/g,'"') : '';
if (errorfunc === alert)
msg = msg.replace(/<br>/g,'\n').replace(/[\n\r]+/, '\n');
errorfunc(msg.replace(/"/g,'"'), det);
return false;
}
else {
return true
}
}

any ideas what's wrong ?

asked in Efficy/ Client side by (115 points)
edited by
Removed customer name in hostname

1 Answer

+2 votes
Best answer

Hello

If you really need the AppBase as global variable in Efficy 11.2 and you cannot get if from the model (this is the new location), you can add this in custom.js:

var AppBase = window.location.href.substr(0, window.location.href.indexOf("crm/") + 4);

For security reasons, browsers restrict cross-origin HTTP requests initiated from within scripts. You cannot mix content from your local environment with data from efficytest.com, that's normal. It might be a result of your AppBase that is wrongly configured.

answered by (7.4k points)
selected by
1,249 questions
1,519 answers
1,859 comments
328 users