You enhance the standard Fixed Asset table so that a fixed asset record cannot be deleted
when the Blocked field is set to TRUE by adding the following code to the On Delete trigger:
IF Blocked THEN
ERROR(CANNOT_DELETE)
CANNOT_DELETE is a text constant containing the ENU caption “You cannot delete this
record because it is blocked.”.
Against the code, a different developer writes a test function named TestBlockedFixedAsset.
The function must pass successfully when the Blocked field is set to TRUE and the record is
being deleted. The test function contains the following code:
FA.INIT;
FA.”No.” := ‘TEST’;
FA.Blocked:= TRUE;
FA.INSERT;
FA.DELETE (TRUE);
You run the test function but it does not pass successfully. How should you update the test
function code so that it passes successfully?
A.
Place GETLASTERRORTEXT before the FA.DELETE(TRUE) statement.
B.
Remove the FA.INSERT statement.
C.
Place ASSERTERROR before the FA.DELETE(TRUE) statement.
D.
Change the FA.DELETE(TRUE) statement to IF FA.DELETE(TRUE) THEN.