Microsoft Dynamics 365 for Finance and Operations (legacy) — Question 8
You are writing an X++ method to delete a SalesLine record.
You need to ensure that the call to the delete() method succeeds.
Which two criteria must be met to accomplish this goal? Each correct answer presents part of the solution.
Answer options
- A. The record to delete must have been read from the database using the forupdate keyword in a select statement.
- B. The dispose() method must be called after the delete() method is called.
- C. The delete() method must be called inside a transaction by using the ttsbegin and ttscommit statements.
- D. The dodelete() method must be used in this case in order to validate the record deletion.
Correct answer: A, C
Explanation
Option A is correct because the record must be locked for update to ensure it can be deleted. Option C is also correct, as performing the delete operation within a transaction ensures that it can be committed or rolled back as necessary. Options B and D are incorrect because they do not pertain to the prerequisites for successfully executing the delete() method.