Hi All,
I am not sure if this is support or SuperOffice communiuty, but I have a site that cannot run CRM Scripts via the task menu button.
Currently the script just has the following code.
#setLanguageLevel 4;
EventData ev = getEventData();
log(ev.getInputValues().toJson());
String test = "1";
If I run the code from the scripting section of the Admin client the script runs with no issues (I have a trace on this).
However, if I link the script to a Task Menu button, when I run the option on the task menu I get the following errors.
At the top of the page I get:
Something went wrong with api/v1/Agents/CRMScript/ExecuteScriptAsEvent: [object Object]
In a pop up dialog I get:
Request failed with status code 403
Nothing gets recorded in the trace, so the script does not even get as far as running.
Does anyone have any idea as to why I would get this issue?
Many thanks,
Trevor
Alle Svar (4)
If you look at network tab of the browser developer console, and check the response of the failing API call, what does the response contain?
Hi David,
It returns this.
{
"Error": true,
"ErrorType": "WebException",
"Message": "The remote server returned an error: (500) Internal Server Error.",
"FriendlyMessage": "",
"ErrorSource": "System",
"InnerError": {
"ErrorType": "SoException",
"Message": "Service call CRMScript.ExecuteScriptAsEvent failed",
"ErrorSource": "SuperOffice.Services.Implementation",
"InnerError": {
"ErrorType": "WebException",
"Message": "The remote server returned an error: (500) Internal Server Error.",
"ErrorSource": "System",
"InnerError": null
}
}
}
But nothing clearer than an Internal Server Error in the response.
Many thanks,
Trevor
Hi,
The ExecuteScriptAsEvent method (and other methods related to executing CRMScript and some request related functionality) internally exexcute an HTTP call to the service module.
Are you sure SymmetricKey and Secret have been setup correctly between the CRM.Web/NetServer installation (docs: https://docs.superoffice.com/en/service/install/index.html#from-84) and if you use AD Auth internally, the impersonation is setup correctly? (docs: https://docs.superoffice.com/en/online/identity/single-sign-on/onsite-sso.html#superoffice-service)
Hi David,
You're a genius !!!
It was the SymmetricKey and Secret that did not match up. Now I have corrected this, the script is running from the task menu.
Thank you very much for your help with this.
Trevor