Single Choice
Easy
QYou need to validate the date and throw an error if the date entered is null or greater than current system date. Which of X++ statements should you use?
ID: #9409
Exception Handling in D365 F&O X++
138 views
Question Info
#9409Q ID
EasyDifficulty
Exception Handling in D365 F&O X++Topic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
Justification:
- This statement is incorrect in the initial comparison. It states that if the input date is not null (that is, it contains a value), then throw an error. This does not meet the requirement, which states to throw an error if the input date is in fact null.
- This statement correctly performs the comparison against the input date. The first comparison checks to see if the input date is equal to null, or if it is after today’s date. If either of these conditions is met, the throw error is then executed.
- This statement is incorrect in the initial comparison. It states that if the input date is not null (i.e. it contains a value), then throw an error. This does not meet the requirement, which states to throw an error if the input date is in fact null.
- This statement is incorrect in the initial comparison. It states that if the input date is not null (that is, it contains a value), then throw an error. This does not meet the requirement, which states to throw an error if the input date is in fact null.
Related Lesson: Code Statements
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic