Skip to content

Commit 80cf1cd

Browse files
committed
Merge branch 'main' of https://github.com/microsoft/BCApps into private/attilatoury/contoso-demo-data-module-for-quality-mgmt
2 parents 6e515f2 + 40d1fcb commit 80cf1cd

File tree

12 files changed

+152
-23
lines changed

12 files changed

+152
-23
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

src/Apps/W1/Quality Management/app/src/Setup/SetupWizard/QltyManagementSetupWizard.Page.al

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ namespace Microsoft.QualityManagement.Setup.SetupWizard;
66

77
using Microsoft.DemoTool;
88
using Microsoft.QualityManagement.Configuration;
9+
using Microsoft.QualityManagement.Configuration.GenerationRule;
10+
using Microsoft.QualityManagement.Document;
911
using Microsoft.QualityManagement.Setup;
1012
using Microsoft.QualityManagement.Setup.ApplicationAreas;
1113
using System.Environment;
1214
using System.Environment.Configuration;
1315
using System.Telemetry;
16+
using System.Utilities;
1417

1518
/// <summary>
1619
/// This setup wizard is used to help configure the system initially.
@@ -32,6 +35,30 @@ page 20438 "Qlty. Management Setup Wizard"
3235
ShowCaption = false;
3336
Visible = false;
3437
}
38+
group(StandardBanner)
39+
{
40+
Caption = '';
41+
Editable = false;
42+
Visible = TopBannerVisible and not (StepDone = CurrentStepCounter);
43+
field(MediaResourcesStd; MediaResourcesStandard."Media Reference")
44+
{
45+
ApplicationArea = All;
46+
Editable = false;
47+
ShowCaption = false;
48+
}
49+
}
50+
group(FinishedBanner)
51+
{
52+
Caption = '';
53+
Editable = false;
54+
Visible = TopBannerVisible and (StepDone = CurrentStepCounter);
55+
field(MediaResourcesDone; MediaResourcesDone."Media Reference")
56+
{
57+
ApplicationArea = All;
58+
Editable = false;
59+
ShowCaption = false;
60+
}
61+
}
3562
group(SettingsFor_StepWelcome)
3663
{
3764
Visible = (CurrentStepCounter = StepWelcome);
@@ -361,9 +388,41 @@ page 20438 "Qlty. Management Setup Wizard"
361388

362389
group(SettingsFor_StepDone_Header_ExpressOnly)
363390
{
364-
ShowCaption = false;
391+
Caption = 'You''re all set!';
365392
Visible = ShowHTMLHeader;
366-
InstructionalText = 'Thank you for installing Quality Management. Get started by navigating to Quality Inspection Templates and Inspection Generation Rules.';
393+
InstructionalText = 'Thank you for installing Quality Management.';
394+
}
395+
396+
group(Control18)
397+
{
398+
Caption = 'Get Started';
399+
InstructionalText = 'Get started by navigating to Quality Inspections and Quality Inspection Generation Rules.';
400+
ShowCaption = false;
401+
402+
field(QualityInspections; QualityInspectionsLbl)
403+
{
404+
Caption = 'Quality Inspections';
405+
ShowCaption = false;
406+
Editable = false;
407+
ApplicationArea = All;
408+
409+
trigger OnDrillDown()
410+
begin
411+
Page.RunModal(Page::"Qlty. Inspection List");
412+
end;
413+
}
414+
field(QualityInspectionGenerationRulesLbl; QualityInspectionGenerationRulesLbl)
415+
{
416+
Caption = 'Quality Inspection Generation Rules';
417+
ShowCaption = false;
418+
Editable = false;
419+
ApplicationArea = All;
420+
421+
trigger OnDrillDown()
422+
begin
423+
Page.RunModal(Page::"Qlty. Inspection Gen. Rules");
424+
end;
425+
}
367426
}
368427
}
369428
}
@@ -421,6 +480,10 @@ page 20438 "Qlty. Management Setup Wizard"
421480
var
422481
QltyManagementSetup: Record "Qlty. Management Setup";
423482
TempRecPreviousQltyManagementSetup: Record "Qlty. Management Setup" temporary;
483+
MediaRepositoryDone: Record "Media Repository";
484+
MediaRepositoryStandard: Record "Media Repository";
485+
MediaResourcesDone: Record "Media Resources";
486+
MediaResourcesStandard: Record "Media Resources";
424487
QltyAutoConfigure: Codeunit "Qlty. Auto Configure";
425488
FeatureTelemetry: Codeunit "Feature Telemetry";
426489
CurrentStepCounter: Integer;
@@ -443,6 +506,7 @@ page 20438 "Qlty. Management Setup Wizard"
443506
ShowNever: Boolean;
444507
ShowHTMLHeader: Boolean;
445508
IsPremiumExperienceEnabled: Boolean;
509+
TopBannerVisible: Boolean;
446510
StepWelcome: Integer;
447511
StepDemoData: Integer;
448512
StepReceivingConfig: Integer;
@@ -458,6 +522,7 @@ page 20438 "Qlty. Management Setup Wizard"
458522

459523
trigger OnInit();
460524
begin
525+
LoadTopBanners();
461526
ShowHTMLHeader := true;
462527
CopyPreviousSetup();
463528

@@ -713,4 +778,17 @@ page 20438 "Qlty. Management Setup Wizard"
713778
ShowNever := QltyManagementSetup."Show Inspection Behavior" = QltyManagementSetup."Show Inspection Behavior"::"Do not show created inspections";
714779
end
715780
end;
781+
782+
local procedure LoadTopBanners()
783+
begin
784+
if MediaRepositoryStandard.Get('AssistedSetup-NoText-400px.png',
785+
Format(CurrentClientType())) and
786+
MediaRepositoryDone.Get('AssistedSetupDone-NoText-400px.png',
787+
Format(CurrentClientType()))
788+
then
789+
if MediaResourcesStandard.Get(MediaRepositoryStandard."Media Resources Ref") and
790+
MediaResourcesDone.Get(MediaRepositoryDone."Media Resources Ref")
791+
then
792+
TopBannerVisible := MediaResourcesDone."Media Reference".HasValue();
793+
end;
716794
}

src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyProductEvents.Codeunit.al

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,4 +425,31 @@ codeunit 30177 "Shpfy Product Events"
425425
internal procedure OnAfterProductsToSynchronizeFiltersSet(var ShopifyProduct: Record "Shpfy Product"; Shop: Record "Shpfy Shop"; OnlyUpdatePrice: Boolean)
426426
begin
427427
end;
428+
429+
/// <summary>
430+
/// Raised after the product variant data has been filled from Business Central Item, Item Variant, and Item Unit of Measure.
431+
/// This event allows customization of the Shopify variant after all standard fields are set, but only when an Item Variant is present.
432+
/// </summary>
433+
/// <param name="ShopifyVariant">The Shopify variant record to be customized.</param>
434+
/// <param name="Item">The source Item record.</param>
435+
/// <param name="ItemVariant">The source Item Variant record.</param>
436+
/// <param name="ItemUnitofMeasure">The source Item Unit of Measure record.</param>
437+
/// <param name="Shop">The Shopify shop context.</param>
438+
[IntegrationEvent(false, false)]
439+
internal procedure OnAfterFillInProductVariantDataFromVariant(var ShopifyVariant: Record "Shpfy Variant"; Item: Record Item; ItemVariant: Record "Item Variant"; ItemUnitofMeasure: Record "Item Unit of Measure"; Shop: Record "Shpfy Shop")
440+
begin
441+
end;
442+
443+
/// <summary>
444+
/// Raised after the product variant data has been filled from Business Central Item and Item Variant (without Unit of Measure).
445+
/// This event allows customization of the Shopify variant after all standard fields are set.
446+
/// </summary>
447+
/// <param name="ShopifyVariant">The Shopify variant record to be customized.</param>
448+
/// <param name="Item">The source Item record.</param>
449+
/// <param name="ItemVariant">The source Item Variant record.</param>
450+
/// <param name="Shop">The Shopify shop context.</param>
451+
[IntegrationEvent(false, false)]
452+
internal procedure OnAfterFillInProductVariantData(var ShopifyVariant: Record "Shpfy Variant"; Item: Record Item; ItemVariant: Record "Item Variant"; Shop: Record "Shpfy Shop")
453+
begin
454+
end;
428455
}

src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyProductExport.Codeunit.al

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ codeunit 30178 "Shpfy Product Export"
428428
ShopifyVariant."Item SystemId" := Item.SystemId;
429429
ShopifyVariant."Item Variant SystemId" := ItemVariant.SystemId;
430430
ShopifyVariant."UoM Option Id" := 2;
431+
ProductEvents.OnAfterFillInProductVariantData(ShopifyVariant, Item, ItemVariant, Shop);
431432
end;
432433
end;
433434

@@ -480,6 +481,7 @@ codeunit 30178 "Shpfy Product Export"
480481
ShopifyVariant."Item SystemId" := Item.SystemId;
481482
ShopifyVariant."Item Variant SystemId" := ItemVariant.SystemId;
482483
ShopifyVariant."UoM Option Id" := 2;
484+
ProductEvents.OnAfterFillInProductVariantDataFromVariant(ShopifyVariant, Item, ItemVariant, ItemUnitofMeasure, Shop);
483485
end;
484486
end;
485487

src/System Application/App/SFTP Client/src/DotnetSFTPFile.Codeunit.al

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ codeunit 9761 "Dotnet SFTP File" implements "ISFTP File"
4949
exit(RenciSFTPFile.Length());
5050
end;
5151

52+
procedure LastWriteTime(): DateTime
53+
begin
54+
exit(RenciSFTPFile.LastWriteTimeUtc());
55+
end;
56+
5257
procedure SetFile(NewFile: DotNet RenciISftpFile)
5358
begin
5459
RenciSFTPFile := NewFile;

src/System Application/App/SFTP Client/src/ISFTPFile.Interface.al

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ interface "ISFTP File"
1313
procedure FullName(): Text
1414
procedure IsDirectory(): Boolean
1515
procedure Length(): BigInteger
16+
procedure LastWriteTime(): DateTime
1617
}

src/System Application/App/SFTP Client/src/SFTPClientImplementation.Codeunit.al

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ codeunit 9763 "SFTP Client Implementation"
123123
FileList."Full Name" := CopyStr(ISftpFile.FullName(), 1, MaxStrLen(FileList."Full Name"));
124124
FileList."Is Directory" := ISftpFile.IsDirectory();
125125
FileList.Length := ISftpFile.Length();
126+
FileList."Last Write Time" := ISftpFile.LastWriteTime();
126127
FileList.Insert();
127128
Index += 1;
128129
end;

src/System Application/App/SFTP Client/src/SFTPFolderContent.Page.al

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ page 9761 "SFTP Folder Content"
4545
{
4646
ApplicationArea = All;
4747
}
48+
field("Last Write Time"; Rec."Last Write Time")
49+
{
50+
ApplicationArea = All;
51+
}
4852
}
4953
}
5054
}

src/System Application/App/SFTP Client/src/SFTPFolderContent.Table.al

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ table 9760 "SFTP Folder Content"
4343
Caption = 'Length', Locked = true;
4444
ToolTip = 'Specifies the size in bytes.';
4545
}
46+
field(6; "Last Write Time"; DateTime)
47+
{
48+
Caption = 'Last Write Time', Locked = true;
49+
ToolTip = 'Specifies the date and time when the file or directory was last modified.';
50+
}
4651

4752
}
4853

0 commit comments

Comments
 (0)