This topic contains 2 replies, has 0 voices, and was last updated by latchadev 7 years, 1 month ago.

  • Author
    Posts
  • #6428 Score: 0

    latchadev
    • Contributions: 0
    • Level 1

    I 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.

  • #6429 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    I have no idea if that is the issue, but I notice you’re not setting a date. Worth a shot trying that I guess.

  • #6430 Score: 0

    latchadev
    • Contributions: 0
    • Level 1

    Thank 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

You must be logged in to reply to this topic.