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

  • Author
    Posts
  • #6420 Score: 0

    latchadev
    • Contributions: 0
    • Level 1

    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:

    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:

    Code:



    ************************************





    2017-03-27T00:00:00




    1
    hour

    _actualTime
    add test!


    Any ideas on what it could be? I must be able to add time from one of our web applications.
    This is a cached copy. Click here to see the original post.

  • #6421 Score: 0

    latchadev
    • Contributions: 0
    • Level 1

    Anyone?? Even the example on the Netsuite site (in SuiteAnswers) doesn’t work. It’s the same “unexpected error occurred” status.

  • #6422 Score: 0

    MikeBucklaew
    • Contributions: 0
    • Level 1

    I do a lot with timebill but not with web services. Not knowing exactly where you started:

    Are you using time entries now and just starting some automation?

    Can you create a new time entry for that employee from the user interface using the same values for job, date, etc?

    Does the job you’re trying to associate have the “Allow Time Entry” box checked in the preferences of the job?

    Do you have “Limit Time and Expenses to Resources” checked and is the employee you’re trying to enter the time for a resource?

    Drop back to the minimum required fields and see what happens with that (employee, hours, tranDate).

    Good Luck

  • #6423 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    Hi latchadev,

    With the mentioned unexpected error, do you have the ID for that unexpected error? I you still have it, I would suggest you to file a support case and provide the mentioned error ticket to our support team so that they would be able to check it on our end to give you an advise to work on your concern.

  • #6424 Score: 0

    latchadev
    • Contributions: 0
    • Level 1

    Thanks Mike, to answer your questions:

    1. I have been reading timeBill records via a netsuite.search(searchRecord), but this is the first time I’m trying to programmatically add a timeBill record.

    2. I was, in fact, able to add time for myself through the Netsuite UI using the web service account that I am using programmatically. That seems interesting, I didn’t expect that to work.

    3. Yes, the job has that in the preferences, many employees, myself included, are adding time for the job.

    4. No, the Limit Time and Expenses to Resources is not checked.

    5. I’ve dropped back and it didn’t make a difference. In our case the Employee, Job, caseTaskEvent and Item is required.

    Chanarbon:

    Thanks for the suggestion. How do I go about setting up a Support case to Netsuite? I’m the only dev working and we’ve never set up a case. Also, is that something we have to pay for, or is the first one or few for free, or does it depend on our account? Please let me know just how I would set it up so I can get the ball rolling. I am under a tight deadline to get this working.

    Here is what I see when I click the Support menu when logged into Netsuite as the webservice account (which is an administrator Role). Is this how I am supposed to set one up? Thanks.

  • #6425 Score: 0

    rnedelkow
    • Contributions: 0
    • Level 1

    latchadev, you can submit a case or issue from SuiteAnswers, or contact NetSuite Customer Service by phone. Visit this SuiteAnswer for details – https://netsuite.custhelp.com/app/an…wers/related/1

You must be logged in to reply to this topic.