Click or drag to resize

OrderOnAfterSendingOrderToErp Field

Occurs after a cart or order has been sent to the ERP.

Namespace:  Dynamicweb.Ecommerce.LiveIntegration.Notifications
Assembly:  Dynamicweb.Ecommerce.LiveIntegration (in Dynamicweb.Ecommerce.LiveIntegration.dll) Version: 3.0.1
Syntax
public const string OnAfterSendingOrderToErp = "Dynamicweb.Ecommerce.LiveIntegration.Notifications.LiveIntegration.OnAfterSendingOrderToErp"

Field Value

Type: String
Examples
C#
using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Ecommerce.LiveIntegration.Notifications;

namespace Dynamicweb.Ecommerce.LiveIntegration.Examples.Notifications
{
    /// <summary>
    /// Class OrderAfterSendToErpSubscriber.
    /// </summary>
    /// <seealso cref="NotificationSubscriber" />
    [Subscribe(Order.OnAfterSendingOrderToErp)]
    public class OrderAfterSendToErpSubscriber : NotificationSubscriber
    {
        /// <summary>
        /// Call to invoke observer.
        /// </summary>
        /// <param name="notification">The notification.</param>
        /// <param name="args">The args.</param>
        public override void OnNotify(string notification, NotificationArgs args)
        {
            var myArgs = (Order.OnAfterSendingOrderToErpArgs)args;

            // TODO: Add code here
            if (myArgs?.Error != null)
            {
                // Error occurred while sending order to ERP
            }
        }
    }
}
See Also