[Quality Management] Add Quality Inspection Result card#8358
[Quality Management] Add Quality Inspection Result card#8358JakovljevicDusan wants to merge 4 commits into
Conversation
| else | ||
| Rec."Evaluation Sequence" := ExistingQltyInspectionResult."Evaluation Sequence" + 1; | ||
|
|
||
| ValidateEvaluationSequenceNotUsedElsewhere(); |
There was a problem hiding this comment.
Redundant uniqueness query inside sequence setter
SetDefaultEvaluationSequence already computes max + 1, which is unique at the moment of reading; the immediate call to ValidateEvaluationSequenceNotUsedElsewhere() issues an extra database query for a condition that cannot normally be true, and produces a confusing error for the user if a race condition happens between the two operations.
Recommendation:
- Remove the
ValidateEvaluationSequenceNotUsedElsewhere()call fromSetDefaultEvaluationSequence. Uniqueness is already enforced byOnInsertRecordandOnModifyRecordtriggers on both pages.
| ValidateEvaluationSequenceNotUsedElsewhere(); | |
| internal procedure SetDefaultEvaluationSequence() | |
| var | |
| ExistingQltyInspectionResult: Record "Qlty. Inspection Result"; | |
| begin | |
| ExistingQltyInspectionResult.SetCurrentKey("Evaluation Sequence"); | |
| ExistingQltyInspectionResult.Ascending(false); | |
| if not ExistingQltyInspectionResult.FindFirst() then | |
| Rec."Evaluation Sequence" := 0 | |
| else | |
| Rec."Evaluation Sequence" := ExistingQltyInspectionResult."Evaluation Sequence" + 1; | |
| end; |
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
|
What & why
Add card page to make it easier to show all settings.
Linked work
Fixes AB#636815