Netsuite - Sales Order Status of item fulfilment - netsuite

Pending Fulfilment is not a helpful status when looking at a sales order
Would like to know the latest status on the item fulfilment record on the sales order itself. Picked, Packed or Shipped.
This button should only show when the status of the sales order pending fulfilment.
Do i acheive this via a workflow? or customized form. We are just not sure where to start! All guidance is appreciated.

Maybe try to create a new custom field and source from item fulfillment status.
See answers from here:
Adding new transaction status in netsuite

Related

User event Before Submit doesn't work in case of automatic PO creation (NETSUITE)

Is it possible to restrict the purchase order created automatically like when any dropship or special offer item selected in sales order?
I can confirm as of very recent discussions and testing with Netsuite that before submit does not trigger on automatically generated purchase orders.
We have an approvals system in place and were hoping purchase orders could be auto generated and stay pending supervisor approval but this is not possible as the before submit does not trigger.
An enhancement request has been raised by Netsuite for this functionality.
The behaviour of dropship and special order items is dependent on a checkbox. If you clear the checkbox when the order is approved then the automatic POs will not be created.
Checkbox clearing may be done by the user or may be done via a Before Submit user event script on the Sales Order.
If the need to restrict PO creation has something to do with PO vendor characteristics where you may also need to restrict general PO creation then you should extract the vendor check to a library file. that way it could be used in the SO beforeSubmit to clear the createpo flag and the PO beforeSubmit to throw an error.
You could also use the PO After Submit "specialorder" or "dropship" events to check the PO vendor after submit and delete the created PO.
However given your explanation in the comments the SO shouldn't be able to be approved. i.e. why take a drop ship order where the components are not orderable?

NetSuite User Event or Workflow on Work Order Close

I looked all over and I can't see to find how to connect a script to the "close" event of the Work Order. Basically, I need to send an email to the Sales Rep for the order that is being fulfilled when the Work Order is "closed" what approach would be better? A workflow or a UserEvent, I looked at workflow as the Close button is a non-standard event. When I went to set up the workflow I didn't see Work Order as a record to attach it to. Any help would be great, thanks
I'm not 100% sure on this, but I'm sure if you did an AfterSubmit User Event, you could get the status of the Work Order. If WorkOrder == 'closed' (whatever the right status is), run your code.
Alternatively, you could build a saved search of WorkOrders that are closed. Run a scheduled script every 15 minutes that will send out an email. Upon sending out the email, tick a checkbox on the WorkOrder to remove it from your Saved Search.
JK, you should be able to build a saved search and use the Alerts feature under the Email tab. Check the box to "Send email alerts when records are created/updated" and enter the recipients in the list under that. If you want it to go only to the Sales Rep for that specific customer, as I assume you do, use the list under 'Recipients from Results' sublist. This means you can have the sales rep returned in the search and choose that field, then the alert will be sent to the relevant rep for each record. You may have to tick the 'Send on Update' option as these records returned by the search will be existing records.
In case you're not familiar with the saved search alerts functionality, the way this works is that as soon as a record of the record type that the saved search is based on meets the conditions specified in the saved search criteria, it fires the alert and emails to the list of recipients specified under 'Specific Recipients' and the result returned by the field specified under 'Recipients from Results.'
What I came to find out is that the Work Order Close status is from a Work Order Close form, in that case just the after submit event takes care of this. Thanks for all your help and sorry I took so long to post this answer

Add field Netsuite amortization schedule

I would like to add a few fields to the amortization schedule record in Netsuite. However my user event script does not run. I used netsuite's debugger and when I view the record it doesn't even seem to recognize that there is a user event script. The script below works perfectly on other record types like a customer record but I can not get it to work on the amortization schedule record.
function addFieldsBeforeLoad(type, form, request){
form.addField('custpage_test', 'text', 'test');
}
This is clearly mentioned in NetSuite help that -
This record is scriptable in server SuiteScript only.
The user events are not supported.
Hope this will help.

How to modify a Customer Refund in an After Submit User Event

After a new Customer Refund record is saved (After Submit user event) I need to communicate with an external web service and then update 2 fields in the record. When this code is executed to load the Customer Refund
var o = nlapiLoadRecord("customerrefund", 1906);
This error message is returned:
INVALID_TRANS_TYP
Transaction type specified is incorrect.
I found a list of supported records in the "Chapter 60 SuiteScript Supported Records" of SuiteScript Developer & Reference Guide which says the Customer Refund is only available in a server side script.
How should I go about updating the Customer Refund record?
Without seeing more code, it looks ok. I would double check that the internalId of 1906 is correct.
Also, if you're just submitting two fields, I would use nlapiSubmitField(), this will take less governance points and be quicker for NetSuite rather than nlapiLoadRecord / nlapiSubmitRecord.
Your code looks correct, if you are updating the current record I would recommend using below code to avoid incorrect internalid:
var o = nlapiLoadRecord("customerrefund", nlapiGetRecordId());
Also, I would recommend that if you need to update the fields, consider using before submit user event script on customer refund and you can update the fields using nlapiSetFieldValue(FIELD_ID, FIELD_VALUE). No need to submit the record in case of before submit.
If your script is deployed in the customer refund record, you can also do nlapiGetRecordType().

Unable to find a matching line for sublist apply with key:

We are seeing failure to Netsuite while updating payments via the netsuite API,
the error message we see is as below Unable to find a matching line for sublist apply with key: [doc,line] and value: [123344,null] where 123344 is the external id of the bill.
Any ideas what might be the cause of this?
Note that SuiteTalk will give you this cryptic little message when you try to create a payment for an invoice that already has an Invoice:Paid In Full transaction status.
Don't get me wrong—it's good that NetSuite has this sanity check. I just wish the error was more helpful.
"Unable to find a matching line for sublist apply with key: [doc,line] and value: [123344,null]"
There is your problem, you can't match a line if you are not passing the line number.
We had the same problem inserting new payments, but it worked using the Internal ID for the Invoice column.
Note that the mapping specification is not clear on how to identify the Invoice when adding/updating payments for it. The API requires an invoice, and it works when you provide the Internal ID for the invoice.
I get this error when creating a customer payment. Below is my code. Make sure invoiceId is invoice's internal id and amount is less than or equal to invoice amount.
CustomerPaymentApply paymentApply = new CustomerPaymentApply();
paymentApply.setAmount(amount);
paymentApply.setApply(true);
paymentApply.setDoc(Long.valueOf(invoiceId));
We were getting this error with the Chargebee-Netsuite integration. The solution was to open the corresponding Accounting Period in Netsuite and rerun the sync.
The first number [123344,null] is the Netsuite internal ID of the affected document. If you navigate to the document in Netsuite and it has a padlock this could be the reason:
Open the Accounting Period for the affected document and rerun the sync. Setup/accounting/manage accounting periods:

Resources