April 1, 2018 · Programming Sage CRM Visual C# Visual Studio Extension Templates VSIX

Sage CRM .NET Templates Visual Studio Extension

When developing for Sage CRM, we have a choice of using ASP or .NET. In the spirit of writing code that is both reusable and readable we do almost all of our development for Sage CRM in .NET (Visual C# more specifically). While using .NET has proved to be a lot more maintainable in the long-run, it can take considerably longer to create a project in Visual Studio and set it up with the correct classes needed for Sage CRM compared to just write an ASP page.

In an attempt to reduce the time it takes setting up and developing a .NET component, I’ve created a Visual Studio extension that contains various wizards that help you create projects and classes for Sage CRM quickly and easily. It also contains a collection of useful snippets for commonly-used methods and objects to help save time during development.

Features

Version 1.0.0 (released 1 April 2018) of the extension contains the following features:

Project Templates

Item Templates

Snippets

Snippet Name Shortcut Description
AppFactory Method scafm Code snippet for creating a method in the AppFactory class to expose a WebObject to Sage CRM.
BuildContents Method scbcm Code snippet for creating a BuildContents method that override the BuildContents method.
Chart Graphic sccg Code snippet for creating a chart that can be inserted into a Sage CRM page.
Confirm Button sccb Code snippet for creating a Confirm Button that can be used to confirm an action with the user.
Entry Group sceg Code snippet for creating an Entry Group that can be rendered on a Sage CRM page.
Find Record scfr Code snippet for searching for a particular instance of an entity. This done by providing a Entity Name and Where Clause.
Get Context Info scgci Code snippet for getting a particular field of a particular entity that is currrently in context.
Graphic Block scgb Code snippet adding a GraphicBlock to a page in Sage CRM.
Help Button schb Code snippet for creating a Help Button that will provide the user with help when clicked.
Horizontal Panel schp Code snippet for creating a Horizontal Panel element to render on a Sage CRM page.
HTML Grid schg Code snippet for creating an HTML Grid in Sage CRM.
List scl Code snippet that adds a list to a page in Sage CRM.
New Record scnr Code snippet creating a new Record object for an Entity.
Query Select scqs Code snippet for getting a QuerySelect object in a Sage CRM page.
Submit Button scsb Code snippet for creating a Submit Button that can be used to submit an HTML Form in Sage CRM.
URL Button scub Code snippet for creating a URL Button that can link to any other page in Sage CRM.
Vertical Panel scvp Code snippet creating a Vertical Panel that can be rendering in a Sage CRM page.

Getting Started

Installing

You can install the extension by either installing the extension through Visual Studio or downloading the VSIX from the Visual Studio Marketplace and then installing it. I would suggest the former since this means that Visual Studio can update the extension automatically when a new version is released.

  1. Open Visual Studio
  2. Go to Tools -> Extensions and Updates...
    extensions_and_updates-ccca45f037dc7eab1be4b5a319bfc658-8f480-3
  3. Select the Online category in the left panel and search for Sage CRM .NET Templates
  4. Install the Sage CRM .NET Templates extension by Ivan Kahl
    sage_crm_dot_net_templates_item-48e8cad6615d2d9c7522f1ae12038bfa-52fd6
  5. Restart Visual Studio and you're good to go!

Downloading the VSIX from Visual Studio Marketplace and then installing it

  1. Go and download Sage CRM .NET Templates on the Visual Studio Marketplace.
    sage_crm_dot_net_templates-802c67a3f5ee71c33d8e425c41e5a851-5698a
  2. Close all instances of Visual Studio that are running.
  3. Run the downloaded VSIX and follow the prompts.
  4. Start Visual Studio and you’re good to go!

Creating your first project

  1. Choose a project that you want to create from the Sage CRM category
  2. Add a reference to the SageCRMNet.dll
  3. Make any modifications you may need to the project
  4. Build the project and deploy it to Sage CRM

A note on SageCRMNet.dll

You will notice that when you create a project, the SageCRMNet.dll is not included in the project. This is because the SageCRMNet.dll is part of the Sage CRM SDK which is only available to those with a Sage CRM Developer License. Once you have the assembly, just include it as a reference in the project and you will be able to build it.

Final Thoughts

I hope that the extension proves to be useful for you. If you have any improvements you would like to make to it, you are welcome to do so with a pull request. Please just make sure you read the Contributing document before-hand. Otherwise, if you have any feature requests or find a bug, please log them on GitHub and they will be attended to as soon as possible.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket