This topic contains 3 replies, has 0 voices, and was last updated by Vesku1980 7 years, 9 months ago.
-
AuthorPosts
-
January 27, 2017 at 9:50 am #21906
cjaQuestion here: http://stackoverflow.com/questions/4…ng-suitescript
This is a cached copy. Click here to see the original post. -
January 27, 2017 at 10:14 am #21907
khultquistUsing the browser console, I loaded a Location record, then used .getAllFields() to see all the field names available. From here you should be able to test them out and see which ones give you the values you need.
1:"custrecordlocation_…"
2:"custrecordlocation_…"
3:"custrecordlocation_…"
4:"custrecordlocation_…"
5:"entryformquerystring"
6:"haschildren"
7:"hasopensalesorders"
8:"id"
9:"isinactive"
10:"mainaddress2_set"
11:"mainaddress_key"
12:"mainaddress_text"
13:"mainaddress_type"
14:"makeinventoryavailable"
15:"makeinventoryavailablestore"
16:"name"
17:"nsapiCT"
18:"origbinactive"
19:"returnaddress2_set"
20:"returnaddress_key"
21:"returnaddress_type"
22:"subsidiary"
23:"type"
24:"zip"
25:"country"
26:"addr2"
27:"addr1"
28:"city"
29:"addr3"
30:"addrphone"
31:"addressee"
32:"dropdownstate"
33:"attention"
34:"override"
35:"state"
36:"addrtext"
37:"returncity"
38:"returnstate"
39:"returncountry"
40:"returnzip"
41:"returnaddress1"
42:"returnaddress2"
43:"nsapiPI"
44:"nsapiSR"
45:"nsapiVF"
46:"nsapiFC"
47:"nsapiPS"
48:"nsapiVI"
49:"nsapiVD"
50:"nsapiPD"
51:"nsapiVL"
52:"nsapiRC"
53:"nsapiLI"
54:"nsapiLC"
55:"nsbrowserenv"
56:"wfPI"
57:"wfSR"
58:"wfVF"
59:"wfFC"
60:"wfPS"
61:"_multibtnstate_"
62:"selectedtab"
63:"externalid"
64:"whence"
65:"customwhence"
66:"wfinstances"
67:"parent"
68:"origparent"
69:"defaultaddressee"
70:"defaultaddrbook"
71:"returnaddress_text"
72:"locationtype"
73:"timezone"
74:"latitude"
75:"longitude"
76:"tranprefix"
77:"logo"
length:78
cja replied on 01/27/2017, 10:43 AM: I need this to work in a RESTlet, which runs on the server.
-
January 27, 2017 at 10:54 am #21908
khultquistI'm not suggesting that you run this on a client… I'm showing how to get the list of all fields on a record for reference, instead of guessing what they might be.
-
January 27, 2017 at 12:23 pm #21909
Vesku1980I get values from those fields like this:
var location = nlapiLoadRecord('location',2)
var subrecord = location.viewSubrecord('mainaddress')
var addr1 = subrecord.getFieldValue('addr1')
var country= subrecord.getFieldValue('country')
var city = subrecord.getFieldValue('city')
var zip = subrecord.getFieldValue('zip')
Answers :
zip = {number} 02340
city = {string} ESPOO
country = {string} FI
addr1 = {string} Ohrakaskenmäki 11 B 1
subrecord = {nlobjSubrecord} address (id=31)
location = {nlobjRecord} location (id=2)
-
AuthorPosts
You must be logged in to reply to this topic.