Browse By Tags

  • 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 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…
  • Working with a Stored Procedure that returns a result set.

    I have discussed calling Stored Procedures from within Sage CRM before in the the article " Using the COM CRM.CreateQueryObj() to call a Stored Procedure ". From that article it can be seen that it is possible to call stored procedures where ever a QueryObject…
  • Using a Create Script to produce an automatically incrementing number.

    This example code is provided by a colleague in Switzerland. It provides an alternative way of creating an automatically incrementing field value. The result of the code is to create an incrementing number that includes the current "year" as a prefix…
  • Using the COM CRM.CreateQueryObj() to call a Stored Procedure.

    Below is some code that illustrates how a Stored Procedure maybe invoked in the QueryObject. var strSQL = "DECLARE @@ret int"; strSQL += " EXEC @@ret=eware_get_identity_id 'notes'"; strSQL += " INSERT notes"; strSQL += " (note_noteid,note_foreigntableid…
  • Populating Default Date Field Values

    This article has been updated. Create Script example Date/Time fields can can have their values set by using the DefaultType property. If DefaultType set to 6 then the field displays the Current Date/Time DefaultType = 6; If DefaultType set to 14…
  • How do I put calculated or derived info in a screen's top content?

    Here you can see it is possible to put calculated or derived information into the topcontent. This question actually came up the last time I was here in Germany, but I suppose it is a common requirement. The example I am going to use is one that requires…
  • Overriding the Default Territories Setting

    When you insert a new record, the Territory field defaults to a territory called Default. This is not a true territory, but a territory placeholder. The Default entry remains in the field until the user selects a territory from the Territory field. The…
  • 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…
  • How can I get the SID in Serverside scripting?

    The SID is the session ID value. The SID may be wanted if you are building a string that represents a hyperlink that will be returned to the browser. The SID after all only is needed for a new web request, we do not actually need it within server side…
  • Using SearchSQL to limit data returned by selection lists

    In the screen shot below we can see the demo user "Susan Maye" is limited to assigned the new opportunity to only people in the "Direct Sales" team. This has been accomplished by using the property of the field (a.k.a entryblock) called SearchSQL. The…
  • Controlling Top Content

    Above is a screen shot that shows a default opportunity summary page. At the top of the page is the frame that contains the TopContent information. Sometimes this is called the context information. In this screen the TopContent brings in data from the…
  • Field Level Scripting in Search Screens

    Imagine the situation where there may be a problem with allowing users to search against a entity with out putting in at least one search criterion. You may find the searching against companies too slow if people do not put in the company name for example…
  • Field Level Security and Create Scripts

    The control of field level security can be found against each field listed under the Field tab in the customization area. Administration | Customization | TableName We know from the documentation that the field security interface provides a simple code…
  • Getting Hold of User Information in Code

    If you need to control the display of screen elements like buttons in ASP pages (or even client side in the browser screens) according to the identity of the CRM users then you will obviously need to be able to access the current user id. In ASP pages…
  • Make field ReadOnly when it contains a value

    I have a requirement where once the field has been populated, it should be read only. I have placed the following script in the Create Script area for the field on the screen. However, it is not working. The field is coming up as read only. However, it…
  • Opportunity Adding New Panel [SafeCall Exception]

    Help! I am getting a [SafeCall Exception] error message on the screen after creating a new opportunity. This is the error that I am getting. [SafeCall Exception]: SQL Error oppo_dummy jscript error: [SafeCall Exception]: SQL Error Line: 38 Char: 0…
  • CRM.FindRecord Context in Create Script

    I'm still trying to 'connect the dots' in my understanding of the javascript Create and Validate rule scripts. Specifically, can 'out of context' data be queried? Or maybe there is another way to accomplish my task? In a case workflow, I need to filter…
  • Select List Option and Trigger Input of Value

    Hello, I am hoping to have an option in a normal select field selected and the value chained in the statement, entered directly to a integer field. I am not able to trigger the update on selection until the screen is submitted - saved and then…
  • Using SearchSQL in Workflow

    Hello Have a client who wants to restrict values in a list for a Adv Search Select field in a case based on the value in another field on the case. Were they doing this via updating the field on the Case Detail screen, then I have a Createscript done…
  • How to hide a field on page load event and make it visible when a selected item in a dropdown is changed?

    I managed to hide a field by using hidden=true; in createScript section. The problem is, how can i make it visible again after the page load event? I am trying to make it visible in OnChangeScript section for a dropdown but setting display or visibility…
  • Custom Mail merge fields for word documents.

    Hi, I am currently working on a word document for mail merge. The way i am doing it is that i first create a word doc on my physical machine and i will then include fields which i will acquire from the drop down list. This drop down list can be found…
  • How to set sum of particular field value as default value

    Hi, I am created one custom entity and its having column called "Price". Now whenever summary screen loads, I want to display the total price. I have tried some thing like below: DefaultValue = select sum(frie_Price) from FriEnt; How can I populate…