Use Case 6: Customizing application logic of SyteLine IDO hand-coded method that used Composition Root

Scope:Logic exists only in .NET. Similar scenarios exist as EXTGEN.

Category:Full Code

Tier:OB

TotalSalesYTD.home is used for this simple example, with the customization intended to replace the amount and caption for the bar chart with a hard-coded amount value and text value, respectively.

Note: This form may be hidden, in which case, the developer would need to Show All Forms in Forms List to proceed with this example exercise.

This use case describes a change that minimizes the amount of code of which to take ownership. It is not required to create a custom entry point.

The extension class code for this example customization resides within <release>_SL10SolutionSDK.zip, beginning with the 2024.04 release.

  1. In SyteLine, Total Sales YTD will show a calculated amount with an X axis label of Amount.Amount
  2. Extension Class Code
    1. The base SyteLine interface is in IHomepage_TotalSales_DataTable.cs. This is a public interface.
    2. The base SyteLine class that implements the base SyteLine interface is in Homepage_TotalSales_DataTable.cs.
    3. The sample customization is in CustomCode\CustomizationWithoutEntryPoint.
      1. The custom project is UE_CustomizationCode.
      2. The custom class that implements the base SyteLine interface that will replace the base SyteLine class is in UE_Homepage_TotalSales.cs.
    4. customcode
    5. Build the UE_CustomizationCode project.
  3. Within SyteLine:
    1. Upload custom UE_CustomizationCode.dll into the IDO Custom Assemblies form. Cloud naming convention shown for Assembly Name (ue_CustomizationCode) mapped to C# UE_CustomizationCode.dll.
    2. assembly_name2
    3. Set up the registration of the custom code.
      1. Create new IDO Custom Assembly on the IDO Custom Assemblies form.
        • Assembly Name: ue_MyExtensions
        • Assembly Type: Build From Source
        • Extend And Replace: CSI.Extensions
        • Save
        • Select Source Code which opens the IDO Extension Class Source Code form.
          • Specify a filename for your IDO Extension Class Source
          • Replace the code within the edit block with the following code which is copied from Source Code for CSI.Extensions. This is where the registration of the custom service will be specified.
            using System;
            using System.Collections.Generic;  
            
            // Please do not modify the namespace. 
            // Please ensure the class name is Services.
            namespace CSI.Extensions 
            {     
                /// <summary>     
                /// The code in this class Services is to register services with related implementations.     
                /// </summary>     
                public partial class Services     
                {         
                    [CSI.CSIExtension]         
                    public IEnumerable<(Type serviceType, Type implementationType)> SytelineSampleServicesWithAnyName
                    {             
                        get             
                        {                 
                            // Please register your services with related implementations. See example below.           
                            // yield return (typeof(CSI.Logistics.Customer.IHomepage_TotalSales_DataTable), typeof(UE_CustomizationCode.UE_Homepage_TotalSales));   
                            yield break;
                        }         
                    }     
                } 
            }
            
        • Replace “SytelineSampleServicesWithAnyName” with your own name such as MyService
        • Uncomment the following line which will result in the registration of the custom implementation UE_CustomizationCode.UE_Homepage_TotalSales for the base SyteLine interface CSI.Logistics.Customer.IHomepage_TotalSales_DataTable)
          • yield return (typeof(CSI.Logistics.Customer.IHomepage_TotalSales_DataTable), typeof(UE_CustomizationCode.UE_Homepage_TotalSales));
        • Save.
      2. Return to the IDO Custom Assemblies form.
      3. It is necessary to have references to every dll used in the registrations list, whether it is base SyteLine code or custom code.
        • Add UE_CustomizationCode to References.
          • This is the dll that contains the custom code.
        • If the reference to the dll containing the base SyteLine code is not already included, it will also need to be added to the References of the build-from-source custom assembly that extends and replaces the base SyteLine CSI.Extensions custom assembly.
      4. Save.
      5. Select Build Assembly. A message displays that the assembly has compiled and updated successfully.
      6. Unload IDO Cache (See Documentation).
      7. Open the Total Sales YTD form and note the Fixed Value 1K as well as the x axis label: Fixed Value from UE_Homepage_TotalSales.
        • fixed_value_from