dw.system
Class Status
Object
dw.system.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.
Status(status : Number)
Creates a Status with a single StatusItem.
Status(status : Number, code : String)
Creates a Status with a single StatusItem.
Status(status : Number, code : String, message : String, parameters : Object...)
Creates a Status with a single StatusItem.
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.
getItems() : List
Returns all status items.
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.
getStatus() : Number
Returns the overall status.
isError() : boolean
Checks if the status is an ERROR.
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.
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.
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.
Constructor Detail
Status
public Status()
Creates a Status object with no StatusItems.

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
public Status(status : Number, code : String)
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
public Status(status : Number, code : String, message : String, parameters : Object...)
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
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.
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
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.
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.

getItems
getItems() : List
Returns all status items.
Returns:
all status items.

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

isError
isError() : boolean
Checks if the status is an ERROR. The Status is an ERROR if one of the contained StatusItems is an ERROR.
Returns:
true if status is an ERROR, false otherwise.

β™₯
Notifications pending to read 9