Hi, I've been trying to add a timeBill record for a couple days now and I am out of ideas. Note- I am able to add other records (e.g, a new Job).
I have tried associating the caseTaskEvent record, the customer record and the item record as required by the UI (using the internal Ids found in an existing timeBill record of mine). I have tried removing/adding different code to see if I would get a different error.I get the same "unexpected error" every time, unless I leave out the employee. If I leave out the employee, I get an error message that makes sense ("employee required").
Here is my example code:
TimeBill tb = new TimeBill(); tb.tranDate = new DateTime(2017, 03, 27); tb.timeType = TimeBillTimeType._actualTime; tb.timeTypeSpecified = true; tb.customer = new RecordRef() { internalId = "1001" }; //job/client field with * in NS var time = new Duration(); time.timeSpan = 1; time.unit = DurationUnit.hour; tb.hours = time; tb.memo = "add test!"; tb.item = new RecordRef() { internalId = "111" }; //service item * in NS tb.caseTaskEvent = new RecordRef() { internalId = "1111" }; //non-billable task in NS UI linked to customer/client/job * tb.employee = new RecordRef() { internalId = "1111" }; WriteResponse r = _service.add(tb); StatusDetail[] status = r.status.statusDetail; And here is the soap request: -<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -<soap:Header> -<applicationInfo xmlns="urn:messages_2016_1.platform.webservices.netsuite.com" soap:actor="3"> <applicationId>************************************</applicationId> </applicationInfo> </soap:Header> -<soap:Body> -<add xmlns="urn:messages_2016_1.platform.webservices.netsuite.com"> -<record xmlns:q1="urn:employees_2016_1.transactions.webservices.netsuite.com" xsi:type="q1:TimeBill"> <q1:employee internalId="1111"/> <q1:tranDate>2017-03-27T00:00:00</q1:tranDate> <q1:customer internalId="1001"/> <q1:caseTaskEvent internalId="1111"/> <q1:item internalId="111"/> -<q1:hours> <timeSpan xmlns="urn:core_2016_1.platform.webservices.netsuite.com">1</timeSpan> <unit xmlns="urn:core_2016_1.platform.webservices.netsuite.com">hour</unit> </q1:hours> <q1:timeType>_actualTime</q1:timeType> <q1:memo>add test!</q1:memo> </record> </add> </soap:Body> </soap:Envelope>
Any ideas on what it could be? I must be able to add time from one of our web applications.