mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 06:36:55 +01:00
- api-page-key-fields-must-be-editable-on-insert.good.al and stored-derived-fields-must-not-be-exposed-directly.good.al: both were writable API pages missing DelayedInsert = true, contradicting this repo's own api-page-delayedinsert-true rule - the canonical "good" samples were teaching code BCQuality itself flags. - dimension-management-wiring.good.al: UpdateDimensionSetID exited early when Customer.Get failed, leaving the previous customer's shortcut dimension and Dimension Set ID in place - the same staleness bug the InheritFromDimSetID = 0 fix (from the prior review round) was meant to prevent, just triggered by a failed lookup instead of a successful one. Now clears the shortcut field and recomputes with an empty source list on a failed lookup too, so GetDefaultDimID correctly returns an empty Dimension Set ID instead of never running.
33 lines
770 B
AL
33 lines
770 B
AL
page 50102 "Project Task API"
|
|
{
|
|
PageType = API;
|
|
APIPublisher = 'contoso';
|
|
APIGroup = 'jobs';
|
|
APIVersion = 'v1.0';
|
|
EntityName = 'projectTask';
|
|
EntitySetName = 'projectTasks';
|
|
SourceTable = "Project Task";
|
|
DelayedInsert = true;
|
|
|
|
layout
|
|
{
|
|
area(content)
|
|
{
|
|
repeater(General)
|
|
{
|
|
field(remainingHours; RemainingHoursCalc) { }
|
|
field(budgetedHours; Rec."Budgeted Hours") { }
|
|
field(hoursUsed; Rec."Hours Used") { }
|
|
}
|
|
}
|
|
}
|
|
|
|
trigger OnAfterGetRecord()
|
|
begin
|
|
Rec.CalcFields("Hours Used");
|
|
RemainingHoursCalc := Rec."Budgeted Hours" - Rec."Hours Used";
|
|
end;
|
|
|
|
var
|
|
RemainingHoursCalc: Decimal;
|
|
}
|