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

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.

Related

Is it possible to have a custom field in Inventory Detail subrecord on Item Receipt? NETSUITE

Just like expiration date on inventory number subrecord on Item Receipt, can we have a custom field for manufacturing date in inventory number subrecord. Is there any feature need to be enabled? Does NetSuite have any functionality of Production/Manufacturing date? or any way to create a custom field in inventory number subrecord that is visible in IR subrecord?
As far as I am aware, it is not possible to add a custom field to the inventory detail subrecord. Checking the CUSTOMISATION > LIST, RECORDS & FIELDS NS menu (using the administrator role), this sub-record is not available. I have, however, in the past re-created the subrecord using a Suitelet and a saved search which auto-populates the item lines with additional columns. Perhaps this route is a potential solution for you too.
I have recently encountered this in an implementation. We were requested to add the Gross Weight and Net Weight fields in the Inventory Details window.
We used a SuiteApp called Lot Auto Number (Answer ID: 100706).

Netsuite UI: Adding a Custom Address Dropdown to Sales Order

has anyone figured out how to have a custom drop down on a sales order of the customer addresses.
When creating the custom field on a Sales Order, you will notice that when you select Address or Address Book, the FILTER USING fields do not show. Only 'country' shows when you select Address and nothing shows when you select Address Book
So to Recap:
I need to create a custom address drop-down field on a sales order that contains all of the customer addresses
It might seem like more work than its worth, but if you build it properly you should be able to re-use this code anywhere else you want the ability to add custom address selection drop downs.
In your before load script user event script you will want to add a new custom field of type 'select'.
To populate the values do a search against the customer record and grab the address fields you need (if this is a new record and the customer isnt set in the before load, you can pass this off to the client script by making a selection called 'REFRESH' or something similar that triggers a post sourcing function to make the update to the field select options).
Make sure to get at least the 'addressinternalid' and the 'addresslabel' fields from the customer (you will likely want them all just in case). Add the results to an array so that you can loop through it to build your custom field select options.
From there it would just be a matter of getting the user's selection and tying it to the correct address based on internal id.
I know I did not provide any specific code examples, but that would be your part of the game to play. Hope this helps, and good luck!

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.

Sharepoint 2010 - Dynamically add new fields in edit or new forms

I'm looking to get some guidance with Sharepoint 2010. I am working on a project which requires a system that would inform concerned users of an outages with their applciation and provide regular updates via email (worflow).
I can accomplish most of the tasks with a simple custom list and workflow. Users would be able to input their start/end time of the outage, description and their update. With a workflow an email would be sent to the concerned users with all the details.
Where the problem starts is that, we have to provide hourly updates on an outage. So I would need to be able to add new update fields dynamically for every new updates and then be able to send all the updates via an email workflow.
At the moment I am just trying to figure out the best way to go about this. I tought that a simple custom list would be sufficient but looks like ill need to create a more complex system. Perhaps ill need to create 3 custom lists, 1 master list that would gather the details from list 1 (cotnains the description, start/end time) and the list 2 (contains updates) and some how link the together.
Would anyone have any advice about this?
I would create 2 lists: 1 main with all details and another one with updates and added multi lookup field to the first list.
OR even better -
added lookup field to the second list and when item is created - set lookup to the item in the list 1. Then you would be able to get all items from the list 2 (updates) by the item in the list 1.
Hope it makes sense.
Regards,
Andrey.
I would consider having following 4 fields apart from whatever you need right now.
1. Update
2. Outage (choice yes/no)
3. Previous updates (hide it on Edit form)
4. latest update hidden (hide this on edit form)
I would use one list. Let the workflow run whenever a new item is created or an existing item is updated.
For new Outage items send the outage email.
For updates:
Every hour check for update on the item
If there is any update then copy the value to latest update and previous updates. Clear the value of update column.
Send email with latest update value.
Once outage is over user updates the update field and makes outage over to yes.
At this point of time the workflow is complete.

Search Filter for one level down in SuiteScript

Basically, what I need to do is get at the Billing Transactions:Internal Id field in a script for searching.
I have a saved Transaction search, where type = Purchase Order. I need to get the PO internalid AND the Billing Transaction: Internal Id. The saved search is fine.
Because in script the nlapiSearchRecord can only get one record, and I have over 9,000 rows, I am doing a loop where I am adding a filter of internalid >= the last internalId of the previous execution (1,000 rows). However, I need the filter for this search to be on the Billing Transaction:Internal Id NOT the PO Internal ID.
What "field" can I use in the nlobjSearchFilter creation to get the Billing Transaction:Internal Id?
Using the NetSuite Records Browser, if you check the Search Filters section for Purchase Orders, there is a filter there called billingtransaction that you can use. There is also a Search Column of the same name, so you can also retrieve that in your results.
Another option, if you have a saved search and are comfortable with your script executing saved searches, you can simply pass the search ID to nlapiSearchRecord or nlapiCreateSearch to execute the saved search or modify it then execute it, respectively. We typically avoid doing this in our code because any Administrator can modify a Saved Search, even Private ones, but it is an option nonetheless.

Resources