dw.system
Class Status

A Status is used for communicating an API status code back to a client. A status
consists of multiple StatusItem. Most often a Status contains only one StatusItem.
For convenience, a message with parameters is formatted using standard
formatting patterns. If you want to display locale-specific messages in your
application, you should use the Status.getCode() as key for a resource bundle.
Properties
code
:
String
(Read Only)
The status code either of the first ERROR StatusItem or when there
is no ERROR StatusITEM, the first StatusItem in the overall list.
The status code is the unique identifier for the message and can be used by
client programs to check for a specific status and to generate a localized
message.
details
:
Map
(Read Only)
The details either of the first ERROR StatusItem or when there
is no ERROR StatusItem, the first StatusItem in the overall list.
error
:
boolean
(Read Only)
Checks if the status is an ERROR. The Status is an ERROR if one of the
contained StatusItems is an ERROR.
static ERROR
:
Number
status value to indicate an ERROR status
items
:
List
(Read Only)
All status items.
message
:
String
(Read Only)
The message either of the first ERROR StatusItem or when there
is no ERROR StatusItem, the first StatusItem in the overall list.
Note: Custom code and client programs must not use this message to identify
a specific status. The getCode() must be used for that purpose. The actual
message can change from release to release.
static OK
:
Number
status value to indicate an OK status
parameters
:
List
(Read Only)
The parameters either of the first ERROR StatusItem or when there
is no ERROR StatusItem, the first StatusItem in the overall list.
status
:
Number
(Read Only)
The overall status. If all StatusItems are OK, the method returns
OK. If one StatusItem is an ERROR it returns ERROR.
Constructor Summary
Status()
Creates a Status object with no StatusItems.
Method Summary
addDetail(key
:
String, value
:
Object)
:
void
Add detail information for the given key of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
addItem(item
:
StatusItem)
:
void
Adds an additional status item to this status instance.
getCode()
:
String
Returns the status code either of the first ERROR StatusItem or when there is no ERROR StatusITEM, the first StatusItem in the overall list.
getDetail(key
:
String)
:
Object
Returns the detail value for the given key of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
getDetails()
:
Map
Returns the details either of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
getMessage()
:
String
Returns the message either of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
getParameters()
:
List
Returns the parameters either of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
isError()
:
boolean
Checks if the status is an ERROR.
Methods inherited from class
Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβthis is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Constructor Detail
Status
public Status(status
:
Number)
Creates a Status with a single StatusItem. The status is set to the given
value.
Parameters:
status
-
either OK or ERROR
Status
Creates a Status with a single StatusItem. The StatusItem is initialized
with the given values.
Parameters:
status
-
either OK or ERROR
code
-
a string representing a more detailed status code, e.g. "IMPEX-120"
Status
Creates a Status with a single StatusItem. The StatusItem is initialized
with the given values.
Parameters:
status
-
either OK or ERROR
code
-
a string representing a more detailed status code, e.g. "IMPEX-120".
message
-
a default human readable message
parameters
-
a list of parameters to construct a custom message
Method Detail
addDetail
Add detail information for the given key of the first ERROR StatusItem
or when there is no ERROR StatusItem, the first StatusItem in the overall list.
Parameters:
key
-
the key of the first ERROR StatusItem or the first StatusItem in the list.
value
-
the detail value.
addItem
addItem(item
:
StatusItem)
:
void
Adds an additional status item to this status instance.
Parameters:
item
-
the status item to add.
getCode
getCode()
:
String
Returns the status code either of the first ERROR StatusItem or when there
is no ERROR StatusITEM, the first StatusItem in the overall list.
The status code is the unique identifier for the message and can be used by
client programs to check for a specific status and to generate a localized
message.
Returns:
the status code
getDetail
Returns the detail value for the given key of the first ERROR StatusItem
or when there is no ERROR StatusItem, the first StatusItem in the
overall list.
Parameters:
key
-
the key for the detail to return.
Returns:
the detail value for the given key of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
getDetails
getDetails()
:
Map
Returns the details either of the first ERROR StatusItem or when there
is no ERROR StatusItem, the first StatusItem in the overall list.
Returns:
the details either of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
getMessage
getMessage()
:
String
Returns the message either of the first ERROR StatusItem or when there
is no ERROR StatusItem, the first StatusItem in the overall list.
Note: Custom code and client programs must not use this message to identify
a specific status. The getCode() must be used for that purpose. The actual
message can change from release to release.
Returns:
the message either of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
getParameters
getParameters()
:
List
Returns the parameters either of the first ERROR StatusItem or when there
is no ERROR StatusItem, the first StatusItem in the overall list.
Returns:
the parameters either of the first ERROR StatusItem or when there is no ERROR StatusItem, the first StatusItem in the overall list.
getStatus
getStatus()
:
Number
Returns the overall status. If all StatusItems are OK, the method returns
OK. If one StatusItem is an ERROR it returns ERROR.
Returns:
either OK or ERROR