Hello @san,
As the codeunit, is call for every time for each Requisition Line, and on "Calculate Plan - Plan. Wksh" also handles the error when it occurs, after execution you can see the errors that occurred for any requisition line. So in this case, if any error occurs for 1 requisition line will not affect other lines in the planning process, and after execution, you can see a warning or error. Make sure to resolve the error before going to do further action in the process.
You can also test this by doing something below:
* Create a codeunit test
* Add any method in this codeunit
* Call this method in OnRun of the codeunit
-> Now where you are calling this codeunit do something like:
var
errorText: Text;
yourCodeunit: Codeunit "Your Codeunit";
begin
ClearLastError();
if not yourCodeunit.Run then begin
errorText:=GetLastErrorText();
end;
end;
Now you have the error text in the errorText variable you save the error in any table or just display it by using the ERROR or Message.
Good Luck :)