Contents tagged with Override

  • How to add validation to Create shipment and confirm shipment in Acumatica

    Hello everybody,

    today I want to write a few words on my latest time spending in Acumatica. Recently I was asked to add additional validations to actions Create shipment:

    and Confirm Shipment:

    Idea was the following, if user clicks on Create shipment action or at Confirm Shipment action, some function should be executed which throws exception and prevents Creation/confirmation of shipment if some conditions are not meet. 

    At first glance task was trivial. I supposed that all that will be needed, just override method Create Shipment of SOOrderEntry and Cofirm Shipment of SOShipmentEntry. And jumped right to the code. 

    In order to modify behavior of those two methods, I've created … more

  • Override Equals method of value types

    Hello everybody.

    Today I want to give some demo.

    using System;

    using System.Diagnostics;

    namespace StackOverflowQuest

    {

    class Program

    {

    struct StructTest

    {

    public string TestString { get; set; }

    //public override bool Equals(object obj)

    //{

    // var ct = (StructTest)obj;

    // return ct.TestString == this.TestString;

    //}

    }

    class ClassTest

    {

    public string TestString { get; set; }

    public override bool Equals(object obj)

    {

    var ct = obj as ClassTest;

    if (ct == null) … more