QuestionQ318

Develop and test code

You are a Dynamics 365 Finance developer for a company that sells pre-owned vehicles. When the company obtains a new vehicle, vehicle identification (VIN) numbers are entered in the VIN field of CustTable.

You must create an event handler that validates new VIN values are at least 10 characters long. The validation must happen when records are saved.

Which three actions should you take, in order?

Drag & Drop
Copy the onWriting event handler on the CustTable table object.
Copy the validatedWrite event handler on the CustTable object.
Add code to perform the validation.
Copy the onModified event handler on the CustTable object.
Add the event handler method to a class.
Explanation

The validatedWrite table event is raised as part of validating a record before it is written, making it appropriate for rejecting a VIN shorter than 10 characters at save time. Generate the validatedWrite handler from CustTable, place the generated handler method in a class, and implement the length check in that method.

Community Discussion

No comments yet. Be the first to start the discussion!