This topic contains 3 replies, has 0 voices, and was last updated by Vesku1980 7 years, 7 months ago.

  • Author
    Posts
  • #21906 Score: 0

    cja
    • Contributions: 0
    • Level 1
  • #21907 Score: 0

    khultquist
    • Contributions: 0
    • Level 1

    Using 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.

  • #21908 Score: 0

    khultquist
    • Contributions: 0
    • Level 1

    I'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.

  • #21909 Score: 0

    Vesku1980
    • Contributions: 0
    • Level 1

    I 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)

You must be logged in to reply to this topic.