This topic contains 5 replies, has 0 voices, and was last updated by rnedelkow 7 years, 7 months ago.
-
AuthorPosts
-
April 4, 2017 at 10:17 am #6420
latchadevHi, 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 NSvar 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. -
April 4, 2017 at 2:20 pm #6421
latchadevAnyone?? Even the example on the Netsuite site (in SuiteAnswers) doesn’t work. It’s the same “unexpected error occurred” status.
-
April 4, 2017 at 3:14 pm #6422
MikeBucklaewI 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
-
April 5, 2017 at 5:24 am #6423
chanarbonHi 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.
-
April 5, 2017 at 9:17 am #6424
latchadevThanks 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.
-
April 5, 2017 at 9:35 am #6425
rnedelkowlatchadev, 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
-
AuthorPosts
You must be logged in to reply to this topic.