How to Required Field in Suitescript for UI and CSV upload - netsuite

Here's the scenario:
If Transaction type is under Order to Cash process (example: sales order or customer invoice, etc.) and Account Type is Revenue or COGS, it will require Product code and region code when adding item line in the sublist.
The Account type will base from the setup of the item.
The rule should apply for both UI in CSV upload across Order to Cash process

At a minimum, you will need a user event script that runs on the sales order, invoice, and any other record you need validation on. On the script deployment record, select CSV Import and User Interface in the Context Filtering tab.
For better user experience, create a client script that calls the same validation when the user saves the record.

Related

Netsuite Sales orders suddenly have an additional step (complete) when done through CSV import

I am updating my company's system so that it supports dropshipping items. Ever since I switched to this type of item it asks me to complete the order after I approved it. what is it that I am missing so that I can skip this step altogether, is it even possible to skip the step, or to complete multiple orders at the same time (like how you can approve multiple orders)?
It bears mentioning the Company operates in Mexico.
the steps I take are as follow:
I create and save a sales order, that is, I put in the client, the document and reference number, and the item, as well as a couple of custom fields
the next screen asks me to approve the order, I do it and it creates the matching purchase order
then instead of being able to invoice, I first have to "complete" which takes me to an order fulfillment form
I save that and the order can be invoiced.
Ideally, after approval, I would just be able to invoice
Generally a sales order is not invoicable until it's been fulfilled.
You can override that at a whole account level by going to
Setup -> Accounting -> Accounting Preferences
Order Management tab
scroll to Invoicing
check 'Invoice in Advance of Fulfillment'
Be aware this is a system level setting and if you used to be able to invoice before fulfillment someone else in your company may have unchecked this setting in the recent past.
Alternatively at the individual item level you can use the 'Can be fulfilled/received' checkbox to allow invoicing without fulfilling. Note that 'Can be fulfilled/received' may not be changed after an item has been ordered.
Normally (US/Canada) an order should not be invoiced until it is shipped. Customer Deposits on Sales Orders are the preferred way to handle pre-payment for GAAP etc reasons.

NetSuite Marketing Campaign - Custom Event Fields - Show values in Marketing Templates

I have a scenario where I want to create a dynamically branded marketing template.
The setup:
In my Brand (Class) list i have added several custom fields (ie. Header Image URL, social links etc...). These are stored fields/
In my campaign record I have a Campaign Event custom field where I can select the brand for each campaign event (custrecord_campaign_event_brand).
Last line (actual brands censored for privacy) was used for testing.
However it seems during the merge, there is nothing in these fields even though i can see the data in the event list on the campaign.
Currently using campaignEvent.custrecord_campaign_event_brand within the advanced PDF template.
Note, when looking at the Customer Group used to generate the merge, it does not show the value I selected on the campaign event.
Current holding my breath for a NetSuite support ticket as well.
According to the NS docs a standard campaign email template cannot reference anything from the campaign except the coupon code.
I don't know if the standard beforeLoad event is emitted for Campaign emails but what I have sometimes had success in adding fields to the standard email templates by using a beforeLoad script on customers that sets values for non-stored custom fields.
Your user event script might need a configured reference for the current campaign but playing with that concept might get you what you need.

Track unowned/Drop Ship inventory in NetSuite

Here is what we are trying to do:
We want to track our vendors Drop Ship inventory which we do not own in NetSuite and be able to use the inventory feed from NetSuite to feed our eCommerce channels for both our owned and unowned inventory.
Here is what we've tried:
1- Enabled multi-location inventory
2- Created a "Drop Ship" location
3- Did an inventory adjustment to allocate inventory to that location
Here is the main issue we are facing:
The inventory should not show up on our balance sheet as we do not actually own it. In the scenario above, our inventory feed works as it should. However, the inventory shows up on our balance sheet.
Any assistance on how to get this to work without having the inventory shown on our balance sheet would be very much appreciated.
You could set cost to zero on the item record to reduce the balance sheet value to zero. To correctly show COGS on your P&L, you would need to add a cost on POs for each drop ship item.
To partially automate the PO process, create a custom column field that stores cost. When a PO is created or on a schedule, use a saved search email notification that includes an import ready CSV with Internal ID, Line ID, the custom cost field and a link to a saved CSV import in the body of the email. When you get the email notification, click the link and proceed to import the attached file with the correct item cost.

Suitescript - How do I access the values in "Subsidiaries" sublist on vendor record?

On the vendor record, I need to loop over the Subsidiaries sublist through a scripted search, to get all of the values. I am specifically trying to find vendors that do not belong to a particular subsidiary.
UPDATE
To clear up my question, I was trying to access the Subsidiaries sublist and not the actual primary subsidiary. However NetSuite said that this is currently not possible and is a requested enhancement.
bluejay92, the vendor search has a join to the subsidiary record, see attach screen shot. You can even check "use expressions" to gain access to the NOT function in the criteria.
Workaround:
1 - Create a user event script that runs after the record is created/edited.
2 - Have the script load the record, get the subsidiaries and create a custom record to save the info so you can search it later.
3 - Export all vendors internal ids in 1 column. Run a CSV import of vendors and map internalid csv column to internalid field to trigger the user event script and populate the custom records.
Extra tip: Make sure the script does 'upserts' to the custom record to avoid duplicates. There should be one record per vendor.

On which context inventory gets changed in Netsuite

I have created a custom checkbox and I have to mark it to true whenever any thing is changed on the record. My problem is I do not have to use lastmodified date because lastmodified is not working as all the items are coming in search. Whenever an item is shipped, it's inventory is changed but i would like to know on which context it changes. It is possible to do with workflow. How?
Inventory change is via different record types in NetSuite, and will not be via item.
I think you will need to write User Event Script or workflow on following record types to detect all Inventory changes:
1) Item Fulfillment
2) Item Receipt
3) Item Transfer
4) Inventory Adjustment
Apart from these there are other mechanism to make an impact on inventory, I am not sure if NetSuite allows user event script or workflows on these:
1) Inventory worksheet
2) Physical Count
For the case of Item being shipped from a Sales Order an Item Fulfillment is created, so, you can deploye your workdlow or user event on Item Fulfillment in that case.
Edit: Transfer Order isn't applicable as #bknights suggested. Inventory alterations would be actually made by Item Fulfillment/Receipt records in case of Transfer Orders.

Resources