Sales Order boi c# , doesn't register the order

SOLVED

I've been using c# to insert customers, now I'm trying to insert an order, I don't get any error but it don't find the order,  I reasearched needed values but maybe I'm missing something

int TaskID = (int)oSS.InvokeMethod("nLookupTask", "SO_SalesOrder_ui");
oSS.InvokeMethod("nSetProgram", TaskID);
using (DispatchObject ordeR = new DispatchObject(pvx.InvokeMethod("NewObject", "SO_SalesOrder_bus", oSS.GetObject())))
{

object[] getNextOrd = new object[] { "" };
ordeR.InvokeMethod("nGetNextSalesOrderNo", getNextOrd);

ordeR.InvokeMethod("nSetKey", getNextOrd );


ordeR.InvokeMethod("nSetValue", "CustomerNo$", "TST");
ordeR.InvokeMethod("nSetValue", "PrintSalesOrders$", "N");
ordeR.InvokeMethod("nSetValue", "PrintPickingSheets$", "N");
ordeR.InvokeMethod("nSetValue", "TaxSchedule$", "NONTAX");
ordeR.InvokeMethod("nSetValue", "SalespersonNo$", "TEST");
ordeR.InvokeMethod("nSetValue", "TermsCode$", "00");
ordeR.InvokeMethod("nSetValue", "SplitCommissions$", "N");

using (DispatchObject soLine = new DispatchObject(ordeR.GetProperty("oLines")))
{
soLine.InvokeMethod("nAddLine");
soLine.InvokeMethod("nSetValue", "ItemCode$", "TST CODE");
soLine.InvokeMethod("nSetValue", "QuantityOrdered", "10");
soLine.InvokeMethod("nWrite");

ordeR.InvokeMethod("nWrite");
}

}