Calling CRM Actions

2 minute read time.
The CRM.URL() method is used to allow you to build correctly formatted URLs that reach back into the application.

Most commonly this is used to interact with ASP pages and with Sage CRM .NET application extensions.

For example to build a button that calls an ASP page the code would look like:

var strCallASPButton = CRM.Button("ASP","save.gif", CRM.Url("myPage.asp"));

or to redirect an ASP page to another ASP page that needs to instantiate the eWare object the code would look like:

Response.Redirect(CRM.URL("mypage.asp"));

For example to redirect an ASP page to a system screen you could use:

Response.Redirect(CRM.URL(130));

or to create a button that references the same action it would look like:

var strFindCompanyButton = CRM.Button("search","search.gif", CRM.Url(130));

Knowing what codes can be used can be something of a mystery and I have been asked whether there is any documentation available for these actions. But the ability to call the CRM actions is not an official API, so can not be officially supported. In many instances however, it is useful that we can redirect to specific places in the CRM screens.

What you may not know is that you do not have to use the action codes, but you can use the action names. The usage of the action names helps solve the problem of not knowing which action code to use. It is vital however that you note that this does not change the fundamental issue of the fact that this is still an unsupported way of invoking CRM behaviour. But we can cheat.

So to call the OpportunityList action we could either call

Response.Redirect(CRM.URL(185));

or

Response.Redirect(CRM.URL("caselist"));

Note:
The concept of managing context has been discussed in the article "Changing Context when jumping between pages using the COM ASP API".

The list of actions that can be used is held in the translation area and are part of the Caption Family 'actionnames'.

Administration -> Customization -> Translations

You can search for translations belonging to the caption family "actionnames".


Because these translations represent the actions that can be called from TabGroups and ButtonGroups many of these are documented as to their effect within the System Administration guide.

Note:

I must stress again that the usage of these actions within the CRM.URL() is not an official method to call behaviour and is therefore unsupported.