title: I'm getting "Cannot generate the next number for the AR Last Reference Number sequence" error when adding payment for sales order through web API
body: <p>When I was trying to add payment to a sales order through web service API, I got "PX.Data.PXSetPropertyException: Error: An error occurred while processing the field Payment Ref. : CS Error #30: Cannot generate the next number for the AR Last Reference Number sequence..". The code is as follows:</p>
  
  <pre><code>  AR302000Content AR302000 = context.AR302000GetSchema();
    context.AR302000Clear();
  
    List&lt;Command&gt; cmds = new List&lt;Command&gt;();
  
  
    //add header info
    cmds.Add(new Value { Value = " &lt;NEW&gt;", LinkedCommand = AR302000.PaymentSummary.ReferenceNbr });
    cmds.Add(new Value { Value = "Payment", LinkedCommand = AR302000.PaymentSummary.Type, Commit = true });
    cmds.Add(new Value { Value = "A123456", LinkedCommand = AR302000.PaymentSummary.Customer });
    cmds.Add(new Value { Value = "MAIN", LinkedCommand = AR302000.PaymentSummary.Location });
    cmds.Add(new Value { Value = "CreditCard", LinkedCommand = AR302000.PaymentSummary.PaymentMethod });
    cmds.Add(new Value { Value = "300.00", LinkedCommand = AR302000.PaymentSummary.PaymentAmount});
    cmds.Add(new Value { Value = "T123456", LinkedCommand = AR302000.PaymentSummary.PaymentRef, Commit = true });
    cmds.Add(new Value { Value = "99000001", LinkedCommand = AR302000.PaymentSummary.CashAccount });
  
    cmds.Add(AR302000.OrdersToApply.ServiceCommands.NewRow);
    cmds.Add(new Value { Value = "00001234", LinkedCommand = AR302000.OrdersToApply.OrderNbr });
    cmds.Add(new Value { Value = "SO", LinkedCommand = AR302000.OrdersToApply.OrderType });
    cmds.Add(new Value { Value = "300.00", LinkedCommand = AR302000.OrdersToApply.OrderTotal });
    cmds.Add(new Value { Value = "300.00", LinkedCommand = AR302000.OrdersToApply.AppliedToOrder });
  
    cmds.Add(AR302000.Actions.Save);
  
    AR302000Content[] AR302000content = context.AR302000Submit(cmds.ToArray());
  </code></pre>
  
  <p>I checked my "numbering sequences" configuration and it looks like the only payment related numbering sequence is "ARPAYMENT", which was correct and plus I believe this "ARPAYMENT" is for "ReferenceNbr" anyway. </p>
  
  <p>There doesn't seem to be a numbering sequence for "PaymentRef", which seems to be what the error message was complaining about. Based on the "help" document, this "Payment Ref" should be able to accept a given string, which I did but seems not working...</p>
  
  <p>Anybody knows what could be wrong?</p>