This topic contains 2 replies, has 0 voices, and was last updated by latchadev 7 years, 7 months ago.
-
AuthorPosts
-
March 31, 2017 at 1:15 pm #6428
latchadevI am trying to create a single timeBill record using the add() method of the NetsuiteService class. I have tried associating the caseTaskEvent record, the customer record and the item record – ALL USING THEIR INTERNAL IDs found in existing timeBill records added through the Netsuite UI. I have also tried removing those associations and just using the employee record. In every single incarnation I get the especially unhelpful and maddening: “Unexpected Error” as a result.
Here is my example code:
Code:
TimeBill tb = new TimeBill();
tb.timeType = TimeBillTimeType._actualTime;
tb.timeTypeSpecified = true;
var time = new Duration();
time.timeSpan = 0.25;
time.unit = DurationUnit.hour;
tb.hours = time;
tb.customer = new RecordRef() { internalId = “xxxx” }; //job/client field with * in NS
tb.memo = “test!”;
tb.item = new RecordRef() { internalId = “xxx”}; //service item * in NS
tb.caseTaskEvent = new RecordRef() { internalId = “xxxx” }; //non-billable task in NS UI linked to customer/client/job *
tb.employee = new RecordRef() { internalId = “xxxx”};
WriteResponse r = _service.add(tb);
StatusDetail[] status = r.status.statusDetail; //UNEXPECTED ERROR- YA!
I have tried adding extra data like record types etc, removing data, everything I can think of. Why is it so hard to add a simple record, and why oh why won’t it return an meaningful error. This is so frustrating.
This is a cached copy. Click here to see the original post. -
March 31, 2017 at 1:56 pm #6429
Olivier Gagnon NCI have no idea if that is the issue, but I notice you’re not setting a date. Worth a shot trying that I guess.
-
April 3, 2017 at 10:01 am #6430
latchadevThank you for your response, but I did set the transDate also (which is the date that you say you worked “x” time for) and it is still returning the same status of “unexpected error” with some hashed string like “xdflexxwuuiqcnbgyttrmnppccp”
Is it possible the api account that our NS Admin set up isn’t allowed to add time for employees? What am I as a user of this API supposed to do with a status of “unexpected error”? How does one troubleshoot that? Should I try to add another record type to see if that works, and if so, which type would be the type to try? Any type?
Should I be looking into a different way of using our NS API for adding time for employees? I must have the ability to add an employees time on a job from one of our internal intranet web applications
-
AuthorPosts
You must be logged in to reply to this topic.