One Time Ship To Error with SalesOrder Business Object in C#

FYI we figured out the solution to this problem. We had to set the CustAllowOTS property of the OrderHed to true, even though the customer was already flagged as allowing one time ship to.

--- In vantage@yahoogroups.com, "Mike" <michael_monnett@...> wrote:
>
> I am having a problem setting the One Time Ship To fields in the Sales Order object. I have taken my code and created a hard coded version of method for the purpose of this forum to make it more simple. This hard coded version also produces the same error. Here is the code:
>
> public int Insert5()
> {
> Epicor.Mfg.BO.SalesOrderDataSet ds = new Epicor.Mfg.BO.SalesOrderDataSet();
> _so.GetNewOrderHed(ds); // (_so is a salesorder object)
> ds.OrderHed[0].Company = "EPIC03";
> ds.OrderHed[0].CustNum = 3; //Cust3 = Barriston from training
> ds.OrderHed[0].BTCustNum = 3;
> ds.OrderHed[0].ShipToCustNum = 3;
> ds.OrderHed[0].TermsCode = "COD";
> ds.OrderHed[0].ShipViaCode = "FDGD";
> ds.OrderHed[0].RowMod = "A";
> ds.OrderHed[0].CurrencyCode = "USD";
>
> //One Time Ship To Fields:
> ds.OrderHed[0].UseOTS = true;
> ds.OrderHed[0].OTSPhoneNum = "222-222-2222";
> ds.OrderHed[0].OTSContact = "Mike Monnett";
> ds.OrderHed[0].OTSName = "Barriston Engineering";
> ds.OrderHed[0].OTSAddress1 = "175 Kellogg Blvd W.";
> ds.OrderHed[0].OTSCity = "St. Paul";
> ds.OrderHed[0].OTSState = "MN";
> ds.OrderHed[0].OTSZIP = "55102";
> ds.OrderHed[0].OTSCountryNum = 1;
>
> _so.Update(ds); //Gives Error: One Time Ship To not allowed for this customer.
> return ds.OrderHed[0].OrderNum;
> }
>
>
> I get the error "One Time Ship To not allowed for this customer." for the line _so.Update(ds). Keep in mind that I set the "Allow One Time Ship To" field to true for Barriston (The customer I am working with). Has anybody seen this before? Thank you in advance for any help.
>
I am having a problem setting the One Time Ship To fields in the Sales Order object. I have taken my code and created a hard coded version of method for the purpose of this forum to make it more simple. This hard coded version also produces the same error. Here is the code:

public int Insert5()
{
Epicor.Mfg.BO.SalesOrderDataSet ds = new Epicor.Mfg.BO.SalesOrderDataSet();
_so.GetNewOrderHed(ds); // (_so is a salesorder object)
ds.OrderHed[0].Company = "EPIC03";
ds.OrderHed[0].CustNum = 3; //Cust3 = Barriston from training
ds.OrderHed[0].BTCustNum = 3;
ds.OrderHed[0].ShipToCustNum = 3;
ds.OrderHed[0].TermsCode = "COD";
ds.OrderHed[0].ShipViaCode = "FDGD";
ds.OrderHed[0].RowMod = "A";
ds.OrderHed[0].CurrencyCode = "USD";

//One Time Ship To Fields:
ds.OrderHed[0].UseOTS = true;
ds.OrderHed[0].OTSPhoneNum = "222-222-2222";
ds.OrderHed[0].OTSContact = "Mike Monnett";
ds.OrderHed[0].OTSName = "Barriston Engineering";
ds.OrderHed[0].OTSAddress1 = "175 Kellogg Blvd W.";
ds.OrderHed[0].OTSCity = "St. Paul";
ds.OrderHed[0].OTSState = "MN";
ds.OrderHed[0].OTSZIP = "55102";
ds.OrderHed[0].OTSCountryNum = 1;

_so.Update(ds); //Gives Error: One Time Ship To not allowed for this customer.
return ds.OrderHed[0].OrderNum;
}


I get the error "One Time Ship To not allowed for this customer." for the line _so.Update(ds). Keep in mind that I set the "Allow One Time Ship To" field to true for Barriston (The customer I am working with). Has anybody seen this before? Thank you in advance for any help.