Download PDF
Download page Developing Custom Code.
Developing Custom Code
This section describes creating a custom code project. You can create a custom code project using either Visual Studio 2022 Community or Visual Studio Code. Creating a custom code project involves:
- Installing NuGet Templates: Install the NuGet templates from the NuGet feed onto your local machine.
- Creating a Project: Use a relevant template to create a new callback and service hook project.
- Building a Project: Once your callback and serviceHook project is developed locally and built without errors, a zip file is automatically generated at the project path. This zip file is ready to be pushed to the import API for deployment on the Conga RLC.
Prerequisites
- Visual Studio 2022 Community or Visual Studio Code is installed. For more details about installation, see Download Visual Studio 2022 Community or Download Visual Studio Code.
- NuGet templates for custom code development are downloaded. Please get in touch with Conga Support for more details about the list of default NuGet templates provided by Conga.
- The OOTB objects and APIs used in custom code are trusted. For more information about adding trusted objects and APIs, see Managing Trusted Objects and Managing Trusted APIs.
- All .NET class library types in use are supported. To access the list of banned types, see .NET Class Library Usage.
To create a custom code project using Visual Studio Code
Open Visual Studio Code.
- Go to Menu > View, and select Terminal from the list, or press Ctrl + ` (backtick) on your keyboard.
Uninstall existing templates by running the following command before installing the NuGet template.
View the list of existing templates.
dotnet new --uninstall
CODECheck for the Conga.Platform.Extensibility.Templates entry in the list and if it is available, run this command to remove it.
dotnet new uninstall Conga.Platform.Extensibility.Templates
CODE- Verify by re-running step a.
Run this command to install a specific version of the NuGet template. Version is the NuGet version number, such as
2023.X.X.X
orlatest
. Please get in touch with Conga Support for more details about the list of default NuGet templates provided by Conga.dotnet new install <NuGet Templates Package Name>::<version>
CODEFor example:
dotnet new install Conga.Platform.Extensibility.Templates::202311.1.0.44
CODEGo to the project directory using the command:
cd <Callback Template ShortName>
CODEIf it must be part of a new directory, first create a directory using these command:
md <Callback Template ShortName> mkdir <Callback Template ShortName>
CODENow you are ready to create a callback or service hook custom code project using a template. Run the following command to create a custom code project.
Use the proper ShortName for the template and ensure that you are in the directory where you want to create a callback or service hook custom code project. The project name you specify below is used as the namespace for each class in the project.dotnet new <Callback Template ShortName> -n <ProjectName>
CODEFor example;
dotnet new pricingbasepricecallback -n SamplePricingBasePriceCallback
CODEGo to the directory in which your csproj file is created with the command:
cd <ProjectName>
CODEFor example:
cd SamplePricingBasePriceCallback
CODEUpdate the template code as needed and then build your project using the command:
dotnet build
CODEIf you get an error related to a PowerShell file, then get the execution policy by running the command:
Get-ExecutionPolicy
CODEIf this returns a
restricted
execution policy, run the following command to update it.Set-ExecutionPolicy remotesigned
CODEThe project is built and the <ProjectName>.zip file is created at the project location.
Perform these steps once to create the Callback or ServiceHook custom code project. Afterward, your team can start working on specific features by creating feature branches. You can se Conga helpers to easily integrate features like data access, telemetry, etc., into custom code.
Please get in touch with Conga Support for helper details.
When the feature development is finished, team members must commit changes to their feature branch and then submit a pull request to a relevant branch, like "dev". Once the responsible owner approves and merges the pull request after a custom code review, the continuous integration (CI) pipeline kicks in automatically. The pipeline generates a build artifact on success.
To create custom code using Visual Studio 2022 Code Community, follow steps 1 to 5, and once project is created, open it in Visual Studio 2022 Code Community to build it. NuGet templates callback are compatible with .NET 6 and work with .NET 6.0 target framework.
To update the NuGet version
Open Visual Studio Code.
- Go to Menu > View, and select Terminal from the list, or press Ctrl + ` (backtick) on your keyboard.
Use the following commands to update the NuGet templates in your project with an appropriate version. This is an example command with sample versions, Replace the version numbers with the latest available versions to use all recent updates. Please get in touch with Conga Support for more details about the list of default NuGet templates provided by Conga.
Packages
dotnet add package Conga.Platform.Extensibility.Library --version 202311.1.0.38 dotnet add package Conga.Revenue.Common.Callback --version 22023.12.0.2 dotnet add package Conga.Approvals.Common.Callback --version 2023.3.0.2 dotnet add package Conga.Contracts.Common.Callback --version 2023.11.0.2
CODE