title: Acumatica Validation for sales order
body: <p>I want to perform few validations on Sales order screen, I am comparing the Customer(customerID) field and the Customer Order(CustomerOrderNbr) field and try to give an error message if both the fields match.</p>
  
  <p>I am not a programmer but I tried some code which is giving lot of errors and i'm not able to fix it...</p>
  
  <pre><code> namespace PX.Objects.SO
  {
    public class SOOrderEntry_Extension:PXGraphExtension&lt;SOOrderEntry&gt;
    {
          public const string ordernbrErrorMessage = "Customer name and customer number cannot be same.";
  
  
      public void SOOrder_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
      {
        if (!ValidateCustomerID(sender, e.Row as SOOrder))
              {
                  PXUIFieldAttribute.SetError&lt;SOOrder.customerID&gt;(sender, e.Row, ordernbrErrorMessage);
              }
       }
  
  
  
        public bool ValidateCustomerID(PXCache sender, SOOrder soOrder)
          {
              if (soOrder != null)
              {
                  string soCustomerID = PXSelectorAttribute.GetField(sender, soOrder, typeof(SOOrder.customerID).Name, soOrder.CustomerID, typeof(Customer.acctCD).Name) as string; 
                  string soCustomerOrderNbr = soOrder.CustomerOrderNbr; 
  
                  if (soCustomerID != null &amp;&amp; soCustomerOrderNbr != null)
                  {
                      return !soCustomerID.Trim().Equals(soCustomerOrderNbr.Trim(), StringComparison.OrdinalIgnoreCase);
                  }
              }             
  
              return true;
  
          }
    }
  }
  </code></pre>
  
  <p>And this is my 1st entry with some customer name and order number</p>
  
  <p><a href="https://i.stack.imgur.com/gybBS.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>And this is my 2nd entry with same customer name and order number</p>
  
  <p><a href="https://i.stack.imgur.com/n7t5g.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>After doing the changes in the code it isn't showing any error message...I restarted the website and checked but no results</p>