• Blog Post: Working with 'Create Follow-Up Task' and 'Create Follow-Up Appointments' using Server Side code

    The image above shows the New Task screen. Both the New Task and New Appointment screens allow a user to Create Follow-up Communications. A customer might have a business requirement to know whether the communication a user is currently entering is actually a followup of another communication. That...
  • Blog Post: The Values() collection

    The Values() collection can be used in all serverside scripts to examine the passed in Values from a form. Create Scripts Validate Scripts Tablelevel Scripts Workflow Scripts The Values() collection must always have an argument passed to it. The Values() collection can not be examined...
  • Blog Post: Correcting inbound data using Table Level scripts and Values() collection

    Occasionally we need to be able to correct data that has been submitted to bring it within tolerance. An example of this maybe where someone has chosen a customer credit limit level that is too high and we need to change this to the maximum allowed value based on the customer current outstanding orders...
  • Blog Post: Using a Table Level Script to Track Changes to Data Made by Users.

    This article uses an idea first mentioned in " Validation Rules Don't Always Mean Stop! ". The example 'UpdateRecord' event function below will write out into a log file which fields have changed. It won't write every field in the screen so we first need to know what fields...
  • Blog Post: Controlling the Detached TableLevel Script Interval

    This article was updated 31st October 2009 to correct hyperlinks. Detached TableLevel Scripts are created in the same way as TableLevel scripts, except you select Detached Table Level from the Script Type list when completing the Table Script details. Unlike TableLevel scripts, Detached Table Level...
  • Blog Post: TableLevel Scripts and SQL TimeOuts

    Any SQL statement may take time to run and result in a timeout error. In Sage CRM the general timeout period is controlled within the Administration -> System -> Database screen by setting the Query Timeout field value. This is expressed in seconds and represents the maximum amount of time that...
  • Blog Post: Interacting Table Level Scripts: A Chain Reaction

    Consider this scenario. There is an UpdateRecord() event function in a TLS on the Company. When the Company assigned user is changed (comp_primaryuserid) then all the 'In Progress' opportunities belonging to that company are reassigned to the new company account manager (oppo_assigneduserid...
  • Blog Post: Using a TableLevel script to Update Submitted Values

    Imagine you have a requirement to a ensure that a particular opportunity field contains certain data as an Opportunity record is inserted. In addition this information should be partially derived from the parent company data. For example the oppo_customerref field should be populated with a values based...
  • Blog Post: Write to the CRM logs in a server-side script

    If you are developing a server-side script such as a Create Script, Validate Script or Table Level Script, it is often useful to write debugging information to a log. Jeff has blogged about a technique for doing this using the Scripting.FileSystemObject. I'd like to share with you a very simple...
  • Blog Post: How do you know if your Table Level Scripts are being executed?

    Hi all, Something I've come across time and time again is where people are not sure if their Table Level Scripts are being executed. It's difficult to see where you went wrong on your table level script if you're not even sure whether it has been executed or not. Furthermore if you...
  • Blog Post: Getting Information about Web Services in Sage CRM

    There are two relevant items of documentation: The Web Services Guide and the System Administration Guide. You can also find general information about the webservices in a recorded webinar within the training section of the DPP website. And there are articles written about webservices on the blog . When...
  • Blog Post: A Table Level Script to update Opportunities when a Company is Reassigned

    A customer had the requirement that when a company was reassigned to a different account manager, the opportunities that belonged to that company that were still in progress should automatically be reassigned to the new company account manager. This was accomplished using an UpdateRecord event function...
  • Blog Post: Function library for tablescripts

    The code on this page was corrected 31st October 2009. Tablescripts are great, they allow you to add code to Sage CRM which will always fire when a table event happens, for example, the company is updated. Look in the developer/admin guides for more details on them. The problem is that you may...
  • Blog Post: CurrentUser object in Serverside Code

    The CurrentUser object can be used in all serverside code including Create Scripts, Validation scripts, Table Level scripts and Workflow javascript conditions. It provides information about the current user session. You can list the properties of the CurrentUser object by using this snippet of code in...
  • Blog Post: More about the Values and FormValues collections

    The Values() and FormValues() collections are serverside methods that are analogous to the ASP Request.Form() and Request.QueryString() collections. In an ASP page we can see the submitted values of the HTML form by examining the Request.Form() collection: e.g. [code language="javascript"...
  • Blog Post: Handling the Data in Multi Select fields in Validate Rules and Table Level Scripts

    This will look at the behaviour of the Values collection. For a more complete discussion see the article The Values() Collection . Imagine a new field called pers_type has been added to the person table and included to the screen personboxlong. The field pers_type is a multiselect and can contain...
  • Blog Post: Conditionally send e-mail on entity creation

    It is common to have CRM send out an e-mail on the creation of a new entity. For example you may have an e-mail sent to the assigned user on a new Opportunity notifying them that a the Opportunity has been created and that it is assigned to them. This is achieved by putting a Send E-mail action on the...
  • Blog Post: Objects Available in the Internal COM API

    The diagram below contains the objects, methods and properties that are the main ones used in the internal COM API of Sage CRM. These objects can be used in field level scripts; Create and Validate and also in TableLevel scripts and Workflow JScript conditions. The are sometimes...
  • Blog Post: Validation of Dates

    The validation of dates can be tricky. Partly this is due to jscript and partly down to the flexibility that Sage CRM provides in allowing dates to be presented. I have covered how default values dates can be controlled in the article: Populating Default Date Field Values Other Date related articles...
  • Blog Post: An example of a Table Level Script showing update of data not submitted from browser

    I have discussed how the Values collection can be used to correct inbound data in the article " Correcting inbound data using Table Level scripts and Values() collection ." This is a further example of how the Values collection can be used. The code sample is from a Table Level script on the...
  • Blog Post: A Trick to Identify in Code which User has been Changed in the User Administration Screens

    Working within the System Admininstration screens can present its own challenges. Please see the article " The SQL Tab Clause and the User Admin screens " for an example of what I mean. Consider if I am working within a the System Administration screen and I want to trigger a set of behaviour...
  • Blog Post: Validating Phone Numbers and Email Addresses

    If you have explored this idea in Sage CRM you will probably have discovered that the peculiar structure of the phone and email screens means that the regular options for screen based rules are not open to us. The phone number table is invisible in Meta Data - it just doesn't appear in the list...
  • Blog Post: Sending an Email from a Table Level Script

    Consider this scenario. When an Opportunity is reassigned then an email needs to be sent to the newly assigned user. The Table Level Script needs to fire correctly whether a single Opportunity is reassigned through the user interface or whether a batch of Opportunities are reassigned by another...
  • Blog Post: A Universal "Go Back" button in Workflow

    The requirement to allow the user to fall back to an earlier point in the workflow is usually handled by looping. We can see from the diagram below how a workflow can allow a user to drop back and repeat or cycle through certain workflow states again and again. But what if we need to have a workflow...
  • Blog Post: Using Hidden fields to detect which System Action triggered a Table Level Script.

    A customer needs to know what particular System Action was used to trigger a Table Level Script. The big problem facing us in this scenario is that the Values() collection usually used in server side scripts to obtain variables passed in from the browser can read any form data but it can not read...