OnTime Extension SDK Documentation
In This Topic
    Build an Extension
    In This Topic

    OnTime Extensions are custom add-ins for OnTime Management Suite and OnTime Dispatch that allow developers to achieve a deep level of embedded integration between an OnTime account and another software system. OnTime Extensions can be created using free tools and a variety of programming languages, including Visual Basic and C#.

    OnTime Extensions can be designed to appear in different places across OnTime Management Suite and OnTime Dispatch. These include independent in the ribbon or contextually under invoices, payments, or tracking. The place in which the extension shows itself is determined by the view from which a class inherits.

    Technical Requirements

    The following tools are required to create an OnTime Extension:

    Independent Extension

    Independent extensions will appear as one or more buttons under the Tools tab of the ribbon at the top of OnTime Management Suite or OnTime Dispatch. Independent extensions have full access to data across OnTime and are a good interface choice for general operations, such as importing or exporting data.


    Example of an independent extension appearing in the ribbon under the Tools tab.

    Follow these steps to create an independent extension:

    1. Open Microsoft Visual Studio
    2. Create a new project of type Class Library (C# or Visual Basic)
    3. Ensure that the project is set to target the .NET Framework 4.0 or higher
    4. Add references to the .NET framework assembly System.AddIn and the assembly OnTime.Extensions.SDK to the project
    5. Create a class or use the class that is supplied when the project is created
    6. Decorate the class with System.AddIn.AddInAttribute and provide the appropriate information for the name, description, publisher, and version of the extension. You may wish to add import or using statements to System.AddIn and OnTime.Extensions.SDK at this point
    7. Set your class to inherit OnTime.Extensions.SDK.IndependentView
    8. Add a method called Initialize() that overrides the Initialize() method inherited from OnTime.Extensions.SDK.IndependentView to your class
    9. Within the Initialize() method, call the method InitializeExtension() providing the appropriate values for the ribbon page group caption and description
    10. Create a new instance of the class OnTime.Extensions.SDK.RibbonButton and include the appropriate values for the button captiondescriptionlarge image (32x32 pixels), small image (16x16 pixels), and the delegate for the button
    11. Add the previously instantiated button to the Buttons property of the OnTime.Extensions.SDK.IndependentView class

    The empty extension class will look similar to the following: 

    <AddIn.AddIn("Extension Name", Description:="Extension description.", Publisher:="Extension Publisher", Version:="1.0.0.0")>
    Public Class Class1
        Inherits OnTime.Extensions.SDK.IndependentView
    
        Public Overrides Sub Initialize()
            InitializeExtension("Ribbon Page Group Caption", "Ribbon Page Group Description")
            Dim button As New OnTime.Extensions.SDK.RibbonButton("Ribbon Button Caption", "Ribbon Button Description", My.Resources.LargeImage, My.Resources.LargeImage, AddressOf MethodForButton)
            Buttons.Add(button)
        End Sub
    
        Private Sub MethodForButton()
            MessageBox.Show("Hello world!")
        End Sub
    
    End Class
    [System.AddIn.AddIn("Extension Name", Description = "Extension description.", Publisher = "Extension Publisher", Version = "1.0.0.0")]
    public class MyExtension : OnTime.Extensions.SDK.IndependentView
    {
        public override void Initialize()
        {
            InitializeExtension("Ribbon Page Group Caption", "Ribbon Page Group Description");
            OnTime.Extensions.SDK.RibbonButton button = new OnTime.Extensions.SDK.RibbonButton("Ribbon Button Caption", "Ribbon Button Description", Properties.Resources.LargeImage, Properties.Resources.SmallImage, MethodForButton);
            Buttons.Add(button);
        }
        private void MethodForButton()
        {
            MessageBox.Show("Hello world!");
        }
    }

    Extension for Order Tracking View

    Contextual extensions can appear as one or more buttons under a tab of the ribbon at the top of OnTime Management Suite or OnTime Dispatch. They can also appear under a context menu associated with a specific list of data, such as orders in the tracking view. Contextual extensions have full access to data across OnTime and are a good interface choice for operations that involve selecting specific records from a list before acting upon them, such as exporting order details to a file or another software system.


    Example of a contextual extension appearing in the context menu of the tracking view.

    Follow these steps to create a contextual extension for the tracking view:

    1. Open Microsoft Visual Studio
    2. Create a new project of type Class Library (C# or Visual Basic)
    3. Ensure that the project is set to target the .NET Framework 4.0 or higher
    4. Add references to the .NET framework assembly System.AddIn and the assembly OnTime.Extensions.SDK to the project
    5. Create a class or use the class that is supplied when the project is created
    6. Decorate the class with System.AddIn.AddInAttribute and provide the appropriate information for the name, description, publisher, and version of the extension. You may wish to add import or using statements to System.AddIn and OnTime.Extensions.SDK at this point
    7. Set your class to inherit OnTime.Extensions.SDK.TrackingView
    8. Add a method called Initialize() that overrides the Initialize() method inherited from OnTime.Extensions.SDK.TrackingView to your class
    9. Within the Initialize() method call the method InitializeTrackingExtension() providing the appropriate values for the ribbon page group caption and description
    10. If you wish to create a button in the ribbon, then create a new instance of the class OnTime.Extensions.SDK.RibbonButton and include the appropriate values for the button captiondescriptionlarge image (32x32 pixels), small image (16x16 pixels), and the delegate for the button
    11. Add the previously instantiated button to the Buttons property of the OnTime.Extensions.SDK.TrackingView class
    12. If you wish to create a context menu button, then create a new instance of the class OnTime.Extensions.SDK.ContextMenuButton and include the appropriate values for the button captionimage (16x16 pixels), a Boolean value indicating if the context menu button should be displayed, and the delegate for the button
    13. Assign the previously instantiated button to the ContextMenuButton property of the OnTime.Extensions.SDK.TrackingView class

    The empty extension class will look similar to the following: 

    <AddIn.AddIn("Extension Name", Description:="Extension description.", Publisher:="Extension Publisher", Version:="1.0.0.0")>
    Public Class MyTrackingExtension
        Inherits OnTime.Extensions.SDK.TrackingView
    
        Public Overrides Sub Initialize()
            InitializeTrackingExtension("Ribbon Page Group Caption", "Ribbon Page Group Description")
            Dim button As New OnTime.Extensions.SDK.RibbonButton("Button Caption", "Button Description", My.Resources.LargeImage, My.Resources.SmallImage, AddressOf MethodForButton)
            Buttons.Add(button)
            Dim cmButton As New OnTime.Extensions.SDK.ContextMenuButton("Button Caption", My.Resources.Image, True, AddressOf MethodForButton)
            ContextMenuButton = cmButton
        End Sub
    
        Private Sub MethodForButton()
            MessageBox.Show("Hello world!")
        End Sub
    
    End Class
    [System.AddIn.AddIn("Extension Name", Description = "Extension description.", Publisher = "Extension Publisher", Version = "1.0.0.0")]
    public class MyTrackingExtension : OnTime.Extensions.SDK.TrackingView
    {
        public override void Initialize()
        {
            InitializeTrackingExtension("Ribbon Page Group Caption", "Ribbon Page Group Description");
            OnTime.Extensions.SDK.RibbonButton button = new OnTime.Extensions.SDK.RibbonButton("Ribbon Button Caption", "Ribbon Button Description", Properties.Resources.LargeImage, Properties.Resources.SmallImage, MethodForButton);
            Buttons.Add(button);
            OnTime.Extensions.SDK.ContextMenuButton cmButton = new OnTime.Extensions.SDK.ContextMenuButton("Button Caption", Properties.Resources.Image, true, MethodForButton);
            ContextMenuButton = cmButton;
        }
        private void MethodForButton()
        {
            MessageBox.Show("Hello world!");
        }
    }

    Extension for Invoices and Payments

    Contextual extensions can appear as one or more buttons under a tab of the ribbon at the top of OnTime Management Suite or OnTime Dispatch. They can also appear under a context menu associated with a specific list of data, such as invoices or payments in the billing view. Contextual extensions have full access to data across OnTime and are a good interface choice for operations that involve selecting specific records from a list before acting upon them, such as exporting invoices and received payments to an accounting software package.


    Example of a contextual extension appearing in the context menu of the invoices list.

    Follow these steps to create a contextual extension for the billing view:

    1. Open Microsoft Visual Studio
    2. Create a new project of type Class Library (C# or Visual Basic)
    3. Ensure that the project is set to target the .NET Framework 4.0 or higher
    4. Add references to the .NET framework assembly System.AddIn and the assembly OnTime.Extensions.SDK to the project
    5. Create a class or use the class that is supplied when the project is created
    6. Decorate the class with System.AddIn.AddInAttribute and provide the appropriate information for the name, description, publisher, and version of the extension. You may wish to add import or using statements to System.AddIn and OnTime.Extensions.SDK at this point
    7. Set your class to inherit OnTime.Extensions.SDK.BillingView
    8. Add a method called Initialize() that overrides the Initialize() method inherited from OnTime.Extensions.SDK.BillingView to your class
    9. If you wish to create an extension for invoice view of OnTime Management Suite, then:
      1. Within the Initialize() method call the method InitializeInvoiceExtension() providing the appropriate values for the export column name, a Boolean value indicating if the export column should be displayedribbon page group caption, and ribbon page group description
      2. If you wish to create a button in the ribbon for the invoice view of OnTime Management Suite, then create a new instance of the class OnTime.Extensions.SDK.RibbonButton and include the appropriate values for the button captiondescriptionlarge image (32x32 pixels), small image (16x16 pixels), and the delegate for the button
      3. Add the previously instantiated button to the InvoiceButtons property of the OnTime.Extensions.SDK.BillingView class
      4. If you wish to create a context menu button for the invoice view of OnTime Management Suite, then create a new instance of the class OnTime.Extensions.SDK.ContextMenuButton and include the appropriate values for the button captionimage (16x16 pixels), a Boolean value indicating if the context menu button should be displayed, and the delegate for the button
      5. Assigned the previously instantiated button to the InvoiceContextMenuButton property of the OnTime.Extensions.SDK.BillingView class
    10. If you wish to create an extension for payment view of OnTime Management Suite, then:
      1. Within the Initialize() method call the method InitializePaymentExtension() providing the appropriate values for the export column name, a Boolean value indicating if the export column should be displayedribbon page group caption, and ribbon page group description
      2. If you wish to create a button in the ribbon bar for the payment view of OnTime Management Suite, then create a new instance of the class OnTime.Extensions.SDK.RibbonButton and include the appropriate values for the button captiondescriptionlarge image (32x32 pixels), small image (16x16 pixels), and the delegate for the button
      3. Add the previously instantiated button to the PaymentButtons property of the OnTime.Extensions.SDK.BillingView class
      4. If you wish to create a context menu button for the payment view of OnTime Management Suite, then create a new instance of the class OnTime.Extensions.SDK.ContextMenuButton and include the appropriate values for the button captionimage (16x16 pixels), a Boolean value indicating if the context menu button should be displayed, and the delegate for the button
      5. Assigned the previously instantiated button to the PaymentContextMenuButton property of the OnTime.Extensions.SDK.BillingView class

    The empty extension class will look similar to the following:

    <AddIn.AddIn("Extension Name", Description:="Extension description.", Publisher:="Extension Publisher", Version:="1.0.0.0")>
    Public Class MyBillingExtension
        Inherits OnTime.Extensions.SDK.BillingView
    
        Public Overrides Sub Initialize()
            InitializeInvoiceExtension("Export Column Name", True, "Ribbon Page Group Caption", "Ribbon Page Group Description")
            Dim invButton As New OnTime.Extensions.SDK.RibbonButton("Ribbon Button Caption", "Ribbon Button Description", My.Resources.LargeImage, My.Resources.LargeImage, AddressOf MethodForInvoiceButton)
            InvoiceButtons.Add(invButton)
            Dim invCmButton As New OnTime.Extensions.SDK.ContextMenuButton("Context Button Caption", My.Resources.Image, True, AddressOf MethodForInvoiceButton)
            InvoiceContextMenuButton = invCmButton
            InitializePaymentExtension("Export Column Name", True, "Ribbon Page Group Caption", "Ribbon Page Group Description")
            Dim pmtButton As New OnTime.Extensions.SDK.RibbonButton("Ribbon Button Caption", "Ribbon Button Description", My.Resources.LargeImage, My.Resources.LargeImage, AddressOf MethodForPaymentButton)
            PaymentButtons.Add(pmtButton)
            Dim pmtCmButton As New OnTime.Extensions.SDK.ContextMenuButton("Context Button Caption", My.Resources.Image, True, AddressOf MethodForPaymentButton)
            PaymentContextMenuButton = pmtCmButton
        End Sub
    
        Private Sub MethodForInvoiceButton()
            MessageBox.Show("Hello world and invoices!")
        End Sub
    
        Private Sub MethodForPaymentButton()
            MessageBox.Show("Hello world and payments!")
        End Sub
    
    End Class
    [System.AddIn.AddIn("Extension Name", Description = "Extension description.", Publisher = "Extension Publisher", Version = "1.0.0.0")]
    public class MyBillingExtension : OnTime.Extensions.SDK.BillingView
    {
        public override void Initialize()
        {
            InitializeInvoiceExtension("Export Column Name", true, "Ribbon Page Group Caption", "Ribbon Page Group Description");
            OnTime.Extensions.SDK.RibbonButton invButton = new OnTime.Extensions.SDK.RibbonButton("Ribbon Button Caption", "Ribbon Button Description", Properties.Resources.LargeImage, Properties.Resources.SmallImage, MethodForInvoiceButton);
            InvoiceButtons.Add(invButton);
            OnTime.Extensions.SDK.ContextMenuButton invCmButton = new OnTime.Extensions.SDK.ContextMenuButton("Button Caption", Properties.Resources.Image, true, MethodForInvoiceButton);
            InvoiceContextMenuButton = invCmButton;
            InitializePaymentExtension("Export Column Name", true, "Ribbon Page Group Caption", "Ribbon Page Group Description");
            OnTime.Extensions.SDK.RibbonButton pmtButton = new OnTime.Extensions.SDK.RibbonButton("Ribbon Button Caption", "Ribbon Button Description", Properties.Resources.LargeImage, Properties.Resources.SmallImage, MethodForPaymentButton);
            PaymentButtons.Add(pmtButton);
            OnTime.Extensions.SDK.ContextMenuButton pmtCmButton = new OnTime.Extensions.SDK.ContextMenuButton("Button Caption", Properties.Resources.Image, true, MethodForPaymentButton);
            PaymentContextMenuButton = pmtCmButton;
        }
        private void MethodForInvoiceButton()
        {
            MessageBox.Show("Hello world and invoices!");
        }
        private void MethodForPaymentButton()
        {
            MessageBox.Show("Hello world and payments!")
        }
    }