Adding list of products to a non sales order - netsuite

Sales-Orders are a built in record type. I am trying to make a custom record type that has a list of items similar to that of a sales-order. Without having to create much custom HTML/JS code is there a way to add this functionality to a custom record type?
I've looked into Parent-Child relationships between records and that looks promising but requires a fair bit of learning on my end and before I invest that time I'd like to know if that is the best way to do it.

There are a couple of ways you can achieve this depending on whether you want sales order like extra fields associated with an item line.
The simplest way would be to include a multi-select custom field referencing item on your custom record. This will give you an item selection box and you can associate items with the custom record.
If that's sufficient then do that and you're good to go.
However if you want details associated with each item (like quantity) you'd need to create a custom line record as well as your custom transaction record.
The line record would have the original custom record as a parent record (custom field type List/Record referencing the parent record and check the "Is Parent" checkbox on the field definition page.
The line record would also need a custom list/record field that references items.
Standard UI forms will now let you add custom line records to your parent record and let you select items and add whatever extra fields you need at the line level.
All configuration; no code.
When you look at the custom parent records though you won't see your custom lines right away because they are under the 'custom tab' you can edit the custom parent record's forms and move the custom sublist to the top of the form's sublists so when you open a custom parent record the associated child line records will be on the first tab.

Related

sorting list of items with specific field on sales order item sublist NetSuite

I like to sort the list of items in the dropdown in the standard NetSuite sublist item. Let's say items are sorted with the name when clicked on >> to open the dropdown list.
Is this possible to sort this list with any other fields, maybe a custom field on items record. let's say I add a custom field on the item record (every item), which is some numbers.
displaying that list with the order by that field.
I have seen a way around to create a custom sublist of my own requirement and then hide the standard and show the custom on a specific record by customizing the form.
I had a similar issue once, I did the following:
You can create a new body field or sublist field based on your business using userevent script(before load).
Create a search with the required order(you can do any operation to prepare your data) after that you filled the result manually to the new custom field.
Whenever the user selects a value in the custom field you set the original one to be the same as the custom one. For this one, you will need a client script.
Note: you can show your custom field and hide or disable the original field only not the whole list since the client script will be responsible to set the value to it. using this approach will not require you to add or edit any of your records which will be helpful if you have a complex process and a lot of dependencies. This approach worked for my issue I hope to be helpful to you too.

NetSuite - Sublist field as link

I have two custom records. They share parent-child record relationship. Child record is shown as sublist view. On Child record, there is a field called Delivery Order. It is a list/record field, But not having hyperlink to open that record. This field is list of a custom record of same name.
There is also a field called Sales Order#, it is a list/record field of Transaction. But it is shown as link which is right.
I want to have hyperlink for Delivery Order. I know that if I use a custom view, I can give a formula(text) field to show that field as a hyperlink, But I want to go with Default View only. I think because of Delivery Order is a custom record, they are not giving hyperlink.

how to enable custom list internal id in Netsuite

NetSuite custom list internal id for values is disabled by default. is there a way i can add my own id for the custom list values.
i am trying to create a custom record to save expense clain details for employee. i have many list to hold datas for diffrent category. it will be better insted of 1,2,3 i can give my own Internal id.
Brett's answer gives you a method by which you can change the text ID of the list, but you cannot change the internal ID of the list's values. This id is set automatically by NetSuite (or probably the underlying database) and is needed to ensure consistency of data within the application. Instead, consider converting the list into a custom record, which will allow you to create another field to use as an external ID, which you can add/update by CSV import (you need to use the Internal ID as key when doing this).
Once converted to a record, you could also add a new field to use as a reference, depending on how you're using it.
To convert to a record, simply check the Convert to Custom Record box on the list page shown in your screenshot and click Save.
Click the “Change Id” button
Enter the new value.
Click Save
Note: Netsuite will prefix the value you enter with ‘customlist’

How to find out what fields are referring to a NetSuite custom field

I have a problem deleting a custom field from a vendor in NetSuite. When I try to delete it I get the following error message.
This custom field cannot be deleted because it is referred to by other custom fields
I've looked at many of my other custom fields and columns but I can't find any that are referencing this one. Is there a way to find all fields that refer to a particular custom field?
This is because you might be using this custom field value some where else. I'm not sure if there is any inbuilt functionality to identify the other fields which are being referred by your custom field. I had a similar issue but I solved it using mass update. I set that field value for all the vendor as blank then I was able to delete the custom field.
In case it is a custom list field then follow the steps bellow :
First delete the list from Setup > Customization > Transaction Item Options, then from the Custom Item Fields and then finally from the Custom Lists
To narrow down the list of fields to check, go to Customization->Lists, Records & Fields->Entity Fields. Sort that list by the Vendor column. That is the list that needs to be checked. Open each of these fields, and check that the 'Field' under the 'Validation and Defaulting' tab is not your custom field that you want to delete. Then check the values on the 'Sourcing and Filtering' tab as well.
Good luck, and hopefully there is not too many vendor fields to check this way!

Sharepoint: Integrity of lookup fields after a list import

I got a question about the behavior of lookup fields when importing data. I wonder how the lookup fields behave when the list they point to is being replaced/imported. To explain the issue, I will provide a quick example below:
As example, assume we have these two sharepoint lists:
Product Types
-------------
+ Type Name
+ Code Nr
+ etc
Products
--------
+ Product Name
+ Product Type (Lookup field to list "Product Types")
+ etc
In my scenario, the Products List contains production data on the production Sharepoint platform. It is filled with data by the business users.
However the Product Types list contains rather static data and is maintained by the developer.
Now after a development cycle, the developer wants to deploy his new webparts and his new data (product types list). The developer performs the following procedure:
On the dev machine: Export "product type" list using stsadm
On the production machine: Delete all items in the "product type" list
On the production machine: Import the "product type" list using stsadm
This means we basically replace the "product type" list on the production server while keeping the "product" list as it is.
Now the question:
Is this safe? Will the lookup references break under certain circumstances?
Any downside of this import/export procedure?
What happens if someone accesses a "product" during the import? Will the (now invalid) reference clear its own content (become a null value).
What happens if the schema of the "product type" list changes (new column)? Will this cause any troubles?
Thanks for all feedback and suggestions!
Update 1
The imported "product type" items have the same IDs as previously deleted ones.
Update 2
Started a bounty to get some more feedback/opinions.
We have had this exact same scenario before. This is a little tricky, depending upon how you will approach it.
1) Delete and Recreate Product Type list through UI
If you delete and recreate the lookup List(Product Type in your case) through UI, then you will lose the connections because the List's id GUID will change upon recreation. So do not go that route.
2) Delete and Recreate Product Type through a Feature
If you had created the Product Type list through a feature.xml file using the <ListInstance> element, then if you delete that list and then recreate it using the same feature (basically Id attribute of ListInstance remains the same, number of list items, i.e. the number of <Row> elements, may change), the association would be maintained. So if you were adding 5 more product types, then if you had created the list using a feature, you could just delete the list and provision the new one using the same feature with extra info for new items and everything would just work!
As a side note, this is the better approach because if you have to do the upgrade on a lot of servers, then rather than doing list export import via stsadm, feature deactivation and activation is a much more recommended solution. This is how we did it.
3)Deleting all list items from Product Type and adding new ones (list is never deleted)
If you are linking the lookup field (in Product List) to the ID field of the lookup list(Product Type), you have to remember that ID is auto-incrementing, so if you delete all items and then add new ones, then their ID's would be different. Say you had 5 items with ID's (ID field is not shown in UI while editing in Datasheet view) 1-5 in the list. If you delete them and add new items, their ID's would start from 6 and not 1 again. So if your lookup field had link to the item with ID 1 in it, then this method is not going to work because there is no item with ID 1 in the Product Type list anymore. So you might want to really try this out before going to production with this method.
4) Editing the list in place
If the list is not extraordinarily huge, and you only have to make this change to one or two instances, could you not just edit the list directly in the datasheet view on the prod server? When editing in datasheet view, do not delete the item, but just overwrite the values of its columns. And you can add more items if you want. This will make sure your ID's are valid.
I have mostly talked about adding new items to the list. Now if you were deleting existing items, then your lookup fields will be affected because assuming you linked the field by ID, the ID is not present anymore since the item has been deleted. Basically, any method you use, maintaining your ID's is critical.
Now regarding your doubts/questions:
I am not too sure about stsadm export import for a list (never done it myself), but stsadm can be tricky as some operations will work on certain scopes only. So you better try out your exact scenario on a dev env.
What happens during an import is tricky again depending on the exact timing. I am sure SP has its own concurrency mechanisms, but you cannot have a definitive answer as it might probably be different based on the stage of the import. If possible, recommended approach is to do the import during a planned downtime.
Regarding changing schema of the list, a change in the schema of a list will not affect the existing list instances (for the most part). If you do this through UI, I believe SP makes changes to the content DB directly. I am not certain how you intend to do this, but if you were to add a column to an existing list using a feature, the way to do this is during feature activation by adding a new content type to the list and adding your new column to this content type. This way you add the column but do not affect the existing list items.
Good luck...
There are two components to a particular lookup: the field, and the field value. The field value only contains the ID of the item(s) it refers to, and the display field. This information is meaningless without the field, which specifies what list to look at and what field to use as the display field.
The primary reason that a Lookup will break occurs on the field scope: either the list it referred to no longer exists, or the list does not contain the required field. These would generally happen if you deleted and recreated the list, but you aren't doing that. If you do break a lookup's list reference, then the only thing you can do is re-create the lookup, because you cannot configure the list reference for a lookup field once it is created.
The downside of your import/export procedure is that you lose the validity of all currently existing lookup values. A lookup maintains its integrity based on the ID of the item it references. So when the display field changes, it still refers to the same item. If you delete the item, then the lookup no longer references it, even if you create a new item that has the same value for the display field. So you would have to reassign all of the products to the new product types.
It should be noted that if you were to revert the deletion of that item, it would return to being on the lookup! The reference to that ID is kept until the actual lookup value is updated (such as by editing the Product).
All of your now invalid references will be null for purposes of interaction. You won't see anything on display forms, and you won't have the options when you try to update the product. When you do update the product, you update it to what you just set it to, which since you can't set the non-existent IDs, means that there are no more references to those IDs.
Any changes to the Product Type list's schema that do not affect the display field specified for the lookup will not have any effect on the lookup integrity. If you do change the display field in any fashion, and of course if you delete it, then it will break in the same fashion as with the list reference. However, you can set the display field, both in the UI and in the object model, so it is easy to fix this.

Resources