| Overview The goal of this sample is manage “investment accounts” related to CRM contacts. This information is maintained in an external database and we want to display the data in a grid at the contact level. We wan to be able to create new record, delete and update existing ones. This sample demonstrates the following: - List records from an external database in a grid
- Add a “CustomAction” to a grid (the “delete” action)
- Use an “ActionPage” to implement the custom action
- Implement a custom “DoubleClickHandler” in a grid
- Use an “Edit” page to create new records and update existing ones
Installation Step 1 – Edit ISV.config This sample must be added as a new link on the left navigation bar of the Microsoft CRM contact edit screen . Therefore we need to edit the “contact” entity section in Microsoft CRM’s ISV.config file like so: Note: you will need to adjust the url in the above sample to match your environment. Step 2 – Copy files In your Visual Studio 2005 project, make sure you have a folder called “Samples” and create a sub-folder called “InvestmentAccounts”. In this new folder, copy the four ASPX pages and their corresponding code behind files: - Delete.aspx
- Investment.aspx
- Investments.aspx
- InvestmentsFetchData.aspx
There are also three files included in this sample that must be copied to the App_Code folder in your solution: - InvestmentAccount.cs
- SqlHelper.cs
- Util.cs
Step 3 – Create the sample database For your convenience, a SQL script called “CreateSampleDatabase.sql” is included with our samples to help you create the database but you can also choose to create it manually if you prefer. If you decide to create it manually, make sure to name it “c360SdkSamples”. Step 4 – Create the table in the sample database For you convenience, we have included a SQL script file called “CreateInvestmentAccountsTable.sql” to create this table and all the required fields. Step 5 – Update the connection string In you project’s web.config add the following: <CONNECTIONSTRINGS> <ADD name="c360SdkSamples" providerName="System.Data.SqlClient" connectionString="Data Source=(local);database=c360SdkSamples;Integrated Security=True;" /> </CONNECTIONSTRINGS> Make sure to edit this connection string to match your environment. Screenshots 




Jeremie Desautels VP, Product Marketing c360 Solutions
|