In Salesforce B2C Commerce, when you need to return a custom status code from a job step, you should use the dw.system.Status class to create and return a new status object with the appropriate status and custom status message. The correct code snippet is option B: var status = require('dw/system/status'); return new Status(Status.OK, 'NO_FILES_FOUND');. This snippet correctly creates a new status object indicating a successful completion (Status.OK) but also communicates the specific outcome of "NO_FILES_FOUND" by using the second parameter of the Status constructor to set a custom status message, aligning with the API's way of handling custom statuses.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit