mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
Transaction and error handling in BC AL - new knowledge articles
This commit is contained in:
parent
7dd3f4777d
commit
4ce7d816cc
19 changed files with 415 additions and 10 deletions
|
|
@ -0,0 +1,23 @@
|
|||
codeunit 50155 "Perf Sample TryFunc Good"
|
||||
{
|
||||
procedure ParseAndProcess(Payload: Text)
|
||||
var
|
||||
ParsedValue: Decimal;
|
||||
begin
|
||||
ClearLastError();
|
||||
if not TryParseDecimal(Payload, ParsedValue) then begin
|
||||
LogParseFailure(Payload, GetLastErrorText());
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
[TryFunction]
|
||||
local procedure TryParseDecimal(Input: Text; var Result: Decimal)
|
||||
begin
|
||||
Evaluate(Result, Input);
|
||||
end;
|
||||
|
||||
local procedure LogParseFailure(Payload: Text; Reason: Text)
|
||||
begin
|
||||
end;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue