back to top

SalesLogix Web Client: Adding both client side and sever side validaiton to a SalesLogix checkbox control

 

I recently ran into a case where I was required to have both a client side validation and a server side event running on a checkbox control on a quick form.  On quickforms I normally inject a client side validation onto a control by using the control’s Attributes.Add.  In the case of the SLXCheckBox control, which is based on the standard ASP.Net Checkbox control, once I added my onClick client side event the server side code would no longer function.  After spending some time trying to figure out why this was the case I finally determined that when the checkbox is rendered in the browsers DOM, it wires up the server side event by using the HTML control’s onClick event, like so:

onClick=javascript:setTimeout(‘__doPostBack(‘ctl00$DialogWorkspace$QuickFormName$ControlName’,”)’, 0)

 The code that I was using on my custom client event was attempting to return a true or false based on a client prompt like so:

 return confirm(‘Are you sure you wanted to check this?’);

Therefore I was attempting to set the controls click event like this:

Control.Attributes.Add(“onClick”, “return confirm(‘Are you sure you wanted to check this’”);

When the checkbox control was rendered on the browser page it looked something like this:

onClick=”return confirm(‘Are you sure you wanted to check this’);setTimeout(‘__doPostBack(‘ctl00$DialogWorkspace$QuickFormName$ControlName’,”)’, 0)

Because it reached the return before ever reaching the standard postback portion of the onClick, the server code would never run.

To get around this I simply made my client validation a function and only returned if the user canceled out of the dialog.  Something like this:

string ClientScript = “function checkReturn() { “;
    ClientScript += ” return confirm(‘Are you sure you wanted to click this?’); }”;   

ScriptManager.RegisterStartupScript(Page, GetType(), “FXCheckReturn”, ClientScript, true);

Control.Attributes.Add(“onClick”, “if(!checkReturn()) return;”);

 By forming the code like this, the rendered onClick event only returns if the user cancels my dialog.  If they do not cancel it, then the code proceeds to the normal postback event, running the server code.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos