This topic contains 3 replies, has 0 voices, and was last updated by pcutler 6 years, 10 months ago.
-
AuthorPosts
-
December 27, 2017 at 3:12 pm #18196
MChammaTXNot sure if I’m doing something wrong but we are validating addresses in NetSuite using an API to check the correct mailing address. If there is a mismatch I display the suggested address with a button to prompt the user the replace or ignore. If I tried to edit the address I get the following error:
NOT_SUPPORTED_ON_CURRENT_SUBRECORD
Am I doing something wrong or can we really not edit addresses client side?
This is a cached copy. Click here to see the original post. -
January 3, 2018 at 6:56 pm #18197
philip.lau@lollicup.comHi MChamma:
You need to edit the subrecord, not a normal record. For example when you edit the customer record, you need to load the customer record first, then access its subrecord. You cannot just use the edit the subrecord without loading the main record.
There is limitation of what client script can do. In most of the time, the client script only allow you to view the subrecord. Hope this help.
-
January 4, 2018 at 10:06 am #18198
MChammaTXOriginally posted by philip.lau@lollicup.com
View Post
Hi MChamma:
You need to edit the subrecord, not a normal record. For example when you edit the customer record, you need to load the customer record first, then access its subrecord. You cannot just use the edit the subrecord without loading the main record.
There is limitation of what client script can do. In most of the time, the client script only allow you to view the subrecord. Hope this help.
I guess this won’t help me on create since both the customer and the address haven’t been committed yet to the database. Ultimately I added my validation directly to the address form. Thanks.
-
January 8, 2018 at 3:45 pm #18199
pcutlerYou can use the address pseudo-fields from SuiteScript 1.0 as a workaround, i.e. nlapiSetCurrentLineItemValue(‘addressbook’, ‘city’, ‘San Francisco’);
From NetSuite Help:
To Create Addresses, You Must Use Subrecord Methods
The address subrecord was introduced in version 2014.2. Prior to that time, each address was represented on a record as a series of body fields or as a line in a sublist.
After the introduction of the address subrecord, SuiteScript 1.0 was enhanced to support two methods of interacting with addresses: In 1.0, you have the choice of interacting with addresses using subrecord APIs, which is the preferred method. But in 1.0 you can also interact with addresses using the legacy approach: setting values for the address body and sublist fields that used to exist. This support was made possible by logic added to the system that read the values set in this manner and created an address subrecord on behalf of the 1.0 script. Because this support exists in 1.0, these deprecated fields are displayed in the SuiteScript Records Browser as available fields.
However, in SuiteScript 2.0, to create an address, you must use subrecord methods. The system does not provide logic for the legacy address body and sublist fields. For that reason, to create, edit, or load an address in SuiteScript 2.0, you must instantiate the address subrecord by referencing the appropriate summary field.
-
AuthorPosts
You must be logged in to reply to this topic.