The links in this article have been corrected and updated.
It might seem that you can't use ASPX pages in the context of Sage CRM, but that is not the case as you can see from the simple example below.
You can create a seperate ASP.NET application and integrate it with Sage CRM, the key point here is that data access is going to be using Web Services.
An ASPX page can be called from a tabgroup or a buttongroup or indeed from an ASP page where the URL has been built using the eWare.URL("mypage.aspx") method. In all these cases the contextual information will be added to the querystring.
This will be in the form of:
The Value keys are in a predicatable form, and the nature of the keys is discussed here:
The most important of the variable name/value pairs that is included in the querystring is the SID. The SID is the session id. This should be valid whether used in ASP pages, the system pages or a webservice interaction.
There is an example of using the SID from an existing system logon here:
The above ASPX example was a simple little project. The fields have been added to the form as below:
Once the Web Reference to the CRM Web Services has been added to the project the code that allowed me to add the company details using the Web Service API looked like this:
myCRM.SessionHeaderValue = new SessionHeader();
myCRM.SessionHeaderValue.sessionId = Request.QueryString.Get("SID");
getversionstringresult CRMVersion = myCRM.getversionstring();
String strCompanyID = Request.QueryString.Get("key1");
queryentityresult CompanyQueryResult = myCRM.queryentity(int.Parse(strCompanyID), "Company");
CRMBase = CompanyQueryResult.records;
company myCompanyRecord = (company)CRMBase;
CompanyNameData.Text = myCompanyRecord.name;
COMPSLADATA.Text = myCompanyRecord.slaid;
CompWebSiteData.Text = myCompanyRecord.website;
CompTypeData.Text = myCompanyRecord.type;
In pages called from the tabgroup "User" in the My CRM area look like:
Key4 here represents the Current Logged on user id. For example to be able to retrieve information from the UserContacts table then you would have to make sure that the table was exposed in Web Services.
For existing tables that you want to expose via the WSDL file then you will need to change the flag (bord_webservicetable) in the custom_tables meta data table. This can only be done in SQL. UserContacts is not exposed to webservices by default.
Within the SageCRM .NET API then the UserContacts table can be interacted with just like any other table. And finally
If you are working with ASP.NET pages using this technique then be aware that if you invoke the Logout method it will log off your main CRM session as well.