recordView.viewWebsite(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Retrieves the website details with requested website fields.

Returns

See the Returns section.

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/commerce/recordView Module

Sibling Module Members

N/commerce/recordView Module Members

Since

2019.1

Parameters

Note:

The options parameter is a JavaScript object.

Property

Type

Required / Optional

Description

options.id

number

required

ID of the website.

options.fields

string | string[]

required

Website fields you want to retrieve. For more information, see Supported Fields.

options.fieldOptions

Array of name, value pairs. Type depends upon parameter.

optional

Options that affect all related fields that are retrieved.

Supported field options: None

Supported Fields

The following fields can be requested in the options.fields parameter:

Record Fields

analyticsclickattributes

displaycompanyfield

onlinepricelevel

shipstoallcountries

analyticssubmitattributes

displayname

outofstockbehavior

showcookieconsentbanner

autoapplypromotionsenabled

hidepaymentpagewhennobalance

outofstockitems

showpofieldonpayment

cartsharingmode

igniteedition

requestshippingaddressfirst

showextendedcart

confpagetrackinghtml

includevatwithprices

requirecompanyfield

showsavecreditinfo

cookiepolicy

isinactive

requireloginforpricing

showshippingestimator

custromeregistrationtype

iswebstoreoffline

requireshippinginformation

siteloginrequired

defaultshippingcountry

internalid

requiretermsandconditions

subsidiaries

defaultshippingmethod

loginallowed

savecreditinfo

termsandconditionshtml

Synthetic Fields

currencies

imagesizes

legacytouchpoints

sortfields

facetfields

languages

shiptocountries

subsidiaries

Errors

Error Code

Thrown If

SSS_INVALID_TYPE_ARG

Parameter is invalid

FIELD_1_CANNOT_BE_EMPTY

Required parameter is empty

Syntax

Important:

The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see N/commerce/recordView Script Sample.

            // Add additional code here
...
try {     
       result.viewItems = recordView.viewWebsite({
       id: 2,
       fields: ["shiptocountries"]
       });
       }
catch (e) {
      result.error = e.name + ": " + e.message;
      }
... 

          

Returns

Returns a flat JSON structure with field:value pairs.

            [{
      "internalid": {
            value : 523
       },
      "name": {
            value : "test"
       },
       "dropdownListField":{
            value : {
                "id": 1,
                "label":"Option 1"
              }
        },
      "checkbox1Field": {
             value : true
       },
      "dateField1Field": {
            value : "2012-04-23T18:25:43.511Z
      }
}, ... ] 

          

Related Topics

N/commerce/recordView Module
N/commerce Modules
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices