Scripting in the Sage CRM interface
Although server-side ASP offers full access to the CRM API, it's sometimes more convenient and quicker to handle tasks using code that runs on the client. You can include server-side and client-side scripts in the same ASP file.
Client-side scripts are processed by the browser, eliminating round-trips to the server. Client-side scripting in CRM ASP pages is handled in the normal way using JavaScript and the DOM.
Some Sage CRM scripting fields expect server-side code, while others accommodate client-side script.
- Server-side code. Use server-side code if you'll use objects from the CRMBlocks hierarchy. Scripts, such as SQL queries, that manipulate databases need server resources to access the specified records.
- Client-side code. Use client-side code for immediate responses to user actions, to access the DOM to navigate the screen interface, and to validate on screen information.
- Use JavaScript, the DOM, the CurrentUser variable, and the ModuleCode variable to configure screens and create event handlers that respond to the current user's profile and modules available on the system.
- Use of client-side validation saves time by checking information that's available on screen before the page is sent to the server for server-side validation. You can enter code directly through the interface so you can verify the connection between interface elements and event-handling code.
For more information, see the System Administrator Help. - For information about client-side classes and modules, see the client-side API reference on the Developer Portal.