CODEUNIT.RUN #3

All good things come in threes, as they say. So here is 3. Codeunit 50000:OnRun()ShipMethod.INIT;ShipMethod.INSERT;ShipMethod.INSERT; // This duplicate statement has been put here intentionally Codeunit 50001:OnRun()IF CODEUNIT.RUN(50000) THEN  MESSAGE(‘OK’)ELSE  MESSAGE(‘LASTERRORTEXT: %1’, GETLASTERRORTEXT); First “from the bare head”, but test it in NAV! Both in classic and RTC. For the latter: easiest:…

Continue reading

CODEUNIT.RUN #2

Another version of my multiple choice question I posed here. Given: Codeunit 50000:OnRun()Cust.INIT;Cust.INSERT;Cust.INSERT; // This duplicate statement has been put here intentionally Codeunit 50001:OnRun()IF CODEUNIT.RUN(50000) THEN  MESSAGE(‘OK’)ELSE  MESSAGE(‘LASTERRORTEXT: %1’, GETLASTERRORTEXT); Which error/message will occur when codeunit 50001 is being executed? ‘OK’ ‘LASTERRORTEXT: The Customer already exists. Identification fields and values:…

Continue reading

CODEUNIT.RUN #1

One of those multiple choice questions I pose to my students at the start of each day during a Solution Development training. What would be the right answer? Of course you’re free to test it in NAV, but first give it a try “from the bare head”. Given: Codeunit 50000:OnRun()ERROR(‘Internal…

Continue reading