Step 1: Create a C# project and add initial code

Complete the next steps to create a screen that displays Company, Person, and Opportunity entry blocks, allowing three records to be entered and saved at the same time. The user is then redirected to the summary screen of the newly created company.

  1. Create a new project in Visual Studio using the Basic template.
  2. Add a new blank C# class to the project:
    1. In Solution Explorer, right-click the new project name, and then click Add | Class.
    1. Select the first type on the list (C# class) and name your class.
  3. Add the following code at the top of the CustomPage.cs file that was automatically created when you selected the Basic template. This code is required to access Sage CRM .NET objects, methods, and properties.
    using Sage.CRM.Blocks;
    using Sage.CRM.Controls;
    using Sage.CRM.Data;
    using Sage.CRM.HTML;
    using Sage.CRM.Utils;
    using Sage.CRM.WebObject;
    using Sage.CRM.UI;
  4. In the CustomPage.cs file, modify the EntryScreen class definition line as follows in order to make this class an instance of the Sage.CRM Web class:
    class EntryScreen: Web
    This allows you to use Sage CRM .NET API calls to write HTML code that builds the screen.
    The Web class provides the BuildContents method to write HTML that displays a screen.
  5. Add the following code to the EntryScreen class to override the base class:
    public override void BuildContents()
    {
    }

Now follow the instructions in Step 2: Add code to get, display, and format blocks to add your code in the braces.