Issues with Script Includes on Quick Forms in the Infor CRM 8.4.03 Web Client

On a quick form in the 8.4.03 Infor CRM web client you can add references to external javascript files to be used on the form.  This is done by adding lines with appropriate url paths to Javascript files via the Script Include property of the Form. I recently discovered an issue when you add scripts but later remove them.

In the XML markup that represents a quick form there is initially an attribute for the Client Include scripts that looks like this:


<ClientScriptIncludes />

When you add an include script that attribute change to something like this:


<ClientScriptIncludes>
<string>~/javascript/MyJavascript.js</string>
</ClientScriptIncludes>

However, if you then remove all of the lines from the Script Include property, the XML attribute now looks like this:


<ClientScriptIncludes>
<string />
</ClientScriptIncludes>

This results in an error after deploying the quick form to the portal and attempting to go to the page the smart part exists on. The error is something along these lines:

“message”: “The string parameter ‘url’ cannot be null or empty.\r\nParameter name: url.”, “source”: “System.Web.UI.ClientScriptManager, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”, “type”: “System.ArgumentException”, “stackTrace”: ” at System.Web.UI.ClientScriptManager.RegisterClientScriptInclude(Type type, String key, String url, Boolean isResource)\r\n at System.Web.UI.ScriptRegistrationManager.RegisterClientScriptInclude(Control control, Type type, String key, String url)\r\n at ASP.DefectDetails.OnFormBound()\r\n at Sage.Platform.WebPortal.SmartParts.EntityBoundSmartPart.OnPreRender(EventArgs e)\r\n at System.Web.UI.Control.PreRenderRecursiveInternal()\r\n at…

The reason for this is because the empty string tag in the ClientScriptIncludes attribute results in a deployed line of code in the OnFormBound method of the resulting ASP.Net user control like this:


ScriptManager.RegisterClientScriptInclude(this, this.GetType(), "56dda568-50e5-4d7b-99d2-710c09f21696", "");

The fourth parameter in that line is supposed to be the URL path to a java script file. Since it is empty, you get an exception.

The only way to fix this is to actually go into the XML markup of the quick form and manually edit the ClientScriptIncludes attribute back to its original format of:

<ClientScriptIncludes />

ABOUT THE AUTHOR

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!