You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PurchaseHeader: Record "Purchase Header";
...
Codeunit.Run(Codeunit::"Purch.Rcpt.-Printed", PurchaseHeader);
fails in an error similar to
Reason why is because the passed record variable does not match the TableNo of the called codeunit.
Good code
PurchRcptHeader: Record "Purch. Rcpt. Header";
...
Codeunit.Run(Codeunit::"Purch.Rcpt.-Printed", PurchRcptHeader);
Suggestion for a new rule would be to check the table of the passed record variable (when passed) to match the tableNo of the called codeunit (if specified).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@Arthurvdv Got a runtime error today, because of badly designed code (in fact a dumb copy-paste error that was not caught by the compiler)
Given the following base application codeunit ...
and below code
fails in an error similar to
Reason why is because the passed record variable does not match the TableNo of the called codeunit.
Good code
Suggestion for a new rule would be to check the table of the passed record variable (when passed) to match the tableNo of the called codeunit (if specified).
Beta Was this translation helpful? Give feedback.
All reactions