Skip to content

Commit 5c326d4

Browse files
Issue 5818, Remerge commit 9415a5a from PR 5837 (#6044)
Remerge of commit 9415a5a from PR 5837 with object renames considered. Changed Schedule Group OnLookup to OnDrillDown, Changed HandleOnLookupSourceTable to be HandleOnAssistEditSourceTable <!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> Changed procedure HandleOnLookupSourceTable to Changed procedure HandleOnAssistEditSourceTable. Changed Schedule Group field from a lookup to a drill-down, and consequently moved code from the table to the page. #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> #5818 #5818 ([AB#611289](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/611289)) . Lookup->AssistEdit, and Lookup->Drilldown changes.
1 parent 6612486 commit 5c326d4

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInspectionGenRule.Table.al

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,6 @@ table 20404 "Qlty. Inspection Gen. Rule"
7070
end else
7171
QltyJobQueueManagement.DeleteJobQueueIfNothingElseIsUsingThisGroup(Rec, xRec."Schedule Group");
7272
end;
73-
74-
trigger OnLookup()
75-
var
76-
QltyJobQueueManagement: Codeunit "Qlty. Job Queue Management";
77-
begin
78-
QltyJobQueueManagement.CheckIfGenerationRuleCanBeScheduled(Rec);
79-
if GuiAllowed() then
80-
if Rec."Schedule Group" = '' then begin
81-
Rec."Schedule Group" := DefaultScheduleGroupLbl;
82-
Rec.Modify(false);
83-
QltyJobQueueManagement.PromptCreateJobQueueEntryIfMissing(Rec."Schedule Group");
84-
end else
85-
QltyJobQueueManagement.RunPageLookupJobQueueEntriesForScheduleGroup(Rec."Schedule Group")
86-
end;
8773
}
8874
field(10; "Template Code"; Code[20])
8975
{
@@ -286,7 +272,6 @@ table 20404 "Qlty. Inspection Gen. Rule"
286272
var
287273
TriggerNotActiveConfirmQst: Label 'You have set an automatic trigger but the inspection generation rule activation is set to "%1". Do you want to update the activation trigger to "%2?"', Comment = '%1=current activation trigger,%2=proposed activation trigger';
288274
RuleCurrentlyDisabledLbl: Label 'The generation rule Sort Order %1, Template Code %2 is currently disabled. It will need to have an activation trigger of "Automatic Only" or "Manual or Automatic" before it will be triggered by "%3"', Comment = '%1=generation rule sort order,%2=generation rule template code,%3=auto trigger';
289-
DefaultScheduleGroupLbl: Label 'QM', Locked = true;
290275
ChooseTemplateFirstErr: Label 'Please choose the template first.';
291276
FilterLengthErr: Label 'This filter is too long and must be less than %1 characters.', Comment = '%1=filter string maximum length';
292277

@@ -328,7 +313,7 @@ table 20404 "Qlty. Inspection Gen. Rule"
328313
end;
329314
end;
330315

331-
internal procedure HandleOnLookupSourceTable()
316+
internal procedure HandleOnAssistEditSourceTable()
332317
var
333318
QltyFilterHelpers: Codeunit "Qlty. Filter Helpers";
334319
QltyInspecGenRuleMgmt: Codeunit "Qlty. Inspec. Gen. Rule Mgmt.";

src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInspectionGenRules.Page.al

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ page 20405 "Qlty. Inspection Gen. Rules"
5757

5858
trigger OnAssistEdit()
5959
begin
60-
Rec.HandleOnLookupSourceTable();
60+
Rec.HandleOnAssistEditSourceTable();
6161
CurrPage.Update();
6262
end;
6363
}
@@ -72,7 +72,7 @@ page 20405 "Qlty. Inspection Gen. Rules"
7272
if Rec.Insert(true) then;
7373
Commit();
7474
end;
75-
Rec.HandleOnLookupSourceTable();
75+
Rec.HandleOnAssistEditSourceTable();
7676
if xRec."Entry No." = Rec."Entry No." then
7777
CurrPage.Update(true);
7878
end;
@@ -148,6 +148,19 @@ page 20405 "Qlty. Inspection Gen. Rules"
148148
}
149149
field("Schedule Group"; Rec."Schedule Group")
150150
{
151+
trigger OnDrillDown()
152+
var
153+
QltyJobQueueManagement: Codeunit "Qlty. Job Queue Management";
154+
begin
155+
QltyJobQueueManagement.CheckIfGenerationRuleCanBeScheduled(Rec);
156+
if GuiAllowed() then
157+
if Rec."Schedule Group" = '' then begin
158+
Rec."Schedule Group" := DefaultScheduleGroupLbl;
159+
Rec.Modify(false);
160+
QltyJobQueueManagement.PromptCreateJobQueueEntryIfMissing(Rec."Schedule Group");
161+
end else
162+
QltyJobQueueManagement.RunPageLookupJobQueueEntriesForScheduleGroup(Rec."Schedule Group")
163+
end;
151164
}
152165
}
153166
}
@@ -379,6 +392,7 @@ page 20405 "Qlty. Inspection Gen. Rules"
379392
RowStyle: Option None,Standard,StandardAccent,Strong,StrongAccent,Attention,AttentionAccent,Favorable,Unfavorable,Ambiguous,Subordinate;
380393
GenerationRulesCaptionLbl: Label 'Quality Inspection Generation Rules';
381394
GenerationRulesCaptionForTemplateLbl: Label 'Quality Inspection Generation Rules for %1', Comment = '%1=the template';
395+
DefaultScheduleGroupLbl: Label 'QM', Locked = true;
382396

383397
trigger OnInit()
384398
begin

0 commit comments

Comments
 (0)