recordView.viewWebsite(options)
|
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 |
|
|
Sibling Module Members |
|
|
Since |
2019.1 |
Parameters
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 |
s |
|
a |
h |
outofstockitems |
showpofieldonpayment |
|
cartsharingmode |
igniteedition |
r |
showextendedcart |
|
confpagetrackinghtml |
includevatwithprices |
requirecompanyfield |
showsavecreditinfo |
|
cookiepolicy |
isinactive |
requireloginforpricing |
showshippingestimator |
|
custromeregistrationtype |
iswebstoreoffline |
r |
siteloginrequired |
|
defaultshippingcountry |
internalid |
r |
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
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
}
}, ... ]