Skip to content
Bitta Apps

Chapter 2 of 6Page 2 of 2

Write and run

Simulate and debug

Simulate runs the same AL and rolls every database change back, so you see the result first. The debugger steps through a simulated run with breakpoints.

updated: applies-to: 1.0.0.0

Use Simulate before any program that changes data.

Simulate

Choose Simulate (Shift+F5). The program runs exactly as it would, then every database change is rolled back. The console shows what happened, and the status says the changes were rolled back.

Code Studio after Simulate: code that renames customer 10000, the console message and the note that all changes were rolled back

In the example, the program renames customer 10000 and shows a message. After Simulate, the customer still has its old name. The Changes tab lists the records the run would have inserted, modified and deleted per table.

Debug

  1. Click in the margin to set breakpoints.
  2. Choose Debug. The debugger records a simulated run, so changes are rolled back here too.
  3. Step over, into, out of and back through the statements, and watch the variables.

What is checked

Simulate and Run both go through the Security Guard of Bitta Apps Studio. Writes to protected tables need GodMode and a prompt, and restricted objects such as posting routines need GodMode. See protected tables.

Every run and simulation is written to the Studio Audit Log with its source.

TIP

Simulate on real data, then run. You see the effect on the records you care about without keeping anything.

What's next

Save programs and versions.

Next step

Ready to try Bitta Code Studio?