Hi everyone, need some help with a rest api reques...
# general
a
Hi everyone, need some help with a rest api request when creating a Vendor Bill using the vendorBill endpoint. Is there a way for Netsuite to automatically set the posting period as an open period when the date is in a closed period. Netsuite does this in the UI when the Bill date is in the past but rest api needs the Bill date to be in an open period, otherwise it errors.
k
past due bill is 99% to be always in a closed period…. and you never want to mess up with periods!
a
@Karina Yep. We’re trying to let Netsuite automatically set the period to an open one when we a create a bill through the api. It does this when creating bills in the UI, but not in the rest api so we get an error.
k
you cannot do that, audit will kill you. find another way. cannot open period ad libitum.
a
Sorry, we’re not trying to open the period. We’re trying to create a bill in an open period using the rest api.
k
But that’s what you are doing - you are trying to open (and then to close) the period because that’s how your designed script works. there is a reason for that - such as your bills is past due when you come to post it in the current period, and it must be that way, that’s how accounting works. Opening a prior period to post a past due bill makes them not past due. What is the purpose of this script? is it to put VB into the corresponding by its date period?
m
I think his problem is that he is trying to create a VB on date say 2/29/2024 on Mars 24 instead of February 24( closed period) By UI the system immediately proposes the 1st open period but the integration tries to force February 24
a
Yes exactly. Sorry I wasn’t very clear.
k
not at all. this is very common and NOT a NS problem 🙂. get your suppliers send the bills on time or create an accrual. but you cannot surcumvent perfectly good ERP process because of some human shortcomings LOL
m
Unfortunately in reality some suppliers are slow to send this and when the company uses a very strict closing period it does not become obvious. So yes indeed it is necessary to pass accruals and reverse them but this does not technically answer the problem @Abhyuday Luthra Since the REST API doesn’t adjust the period automatically like the UI does, you might want to test using a User Event script that triggers on beforeSubmit. This script can check the date of the bill, and if it’s set to a closed period, automatically adjust it to the next open period before the record is submitted. This approach should help avoid those errors and streamline your API integration. Give it a try and see if it resolves the issue But don’t forget : Setup > Integration > SOAP Web Services Preferences check "Run Server Suitescript and Trigger Workflows
k
@Marc - bad acct behavoir should not be rewarded. Besides, they would never get another bank loan - but look, ma, no late VBs ever LOL
@Abhyuday Luthra - create a saved search for all vendors with all the bills and analyse the spend and what VBs consistently come late; create an accrual.
m
@Karina . when you’re dealing with suppliers who might drag their feet, we’ve got to adapt. Especially with an international group that needs to close its books early in the month, we really don’t have much choice. We end up having to record an accrual and then sort it out when the vb actually lands on our desk. And hey, even with the tax audit files bundle, the document date of the vb is noted in document date field so it’s all transparent and above board for audits. It’s not about rewarding any bad behavior; it’s just playing the hand we’re dealt to keep everything tidy and accurate in the accounts.
k
sure..
j
@Abhyuday Luthra I'm surprised leaving the period blank doesn't just let Netsuite do its thing...I'd only expect that error message if you're actually specifying the period alongside the date If you go to Accounting / Set Preferences, what do you have in these settings?
a
Thanks for the suggestions @Marc @Karina I'll try out some of the stuff you've mentioned and see 🙌 @Jon Kears We have the correct settings in our Accounting Preferences, and the posting period is working fine through the UI. Just annoying the REST api doesn't do the same logic of automatically using the first open period for older bill dates.