-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functionality to have job queues with different schedules (#194)
- Loading branch information
Showing
10 changed files
with
325 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
businessCentral/app/src/AssignExportCategoryDialog.page.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
page 82576 "ADLSE Assign Export Category" | ||
{ | ||
ApplicationArea = Basic, Suite; | ||
Caption = 'Assign Export Category'; | ||
PageType = StandardDialog; | ||
DataCaptionExpression = ''; | ||
ModifyAllowed = false; | ||
|
||
layout | ||
{ | ||
area(Content) | ||
{ | ||
field("Export Category"; ExportCategory) | ||
{ | ||
ApplicationArea = Basic, Suite; | ||
Caption = 'Export Catgory'; | ||
TableRelation = "ADLSE Export Category".Code; | ||
ToolTip = 'Specifies Unique Code of an Export Category which can be linked to tables which are part of the export to Azure Datalake.'; | ||
} | ||
} | ||
} | ||
var | ||
ExportCategory: code[50]; | ||
|
||
procedure GetExportCategoryCode(): Code[50] | ||
begin | ||
exit(ExportCategory); | ||
end; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
page 82577 "ADLSE Export Categories" | ||
{ | ||
ApplicationArea = Basic, Suite; | ||
Caption = 'Export Catgories'; | ||
PageType = List; | ||
SourceTable = "ADLSE Export Category"; | ||
|
||
|
||
layout | ||
{ | ||
area(Content) | ||
{ | ||
repeater(General) | ||
{ | ||
field(Code; Rec.Code) | ||
{ | ||
Caption = 'Code'; | ||
} | ||
field(Description; Rec.Description) | ||
{ | ||
Caption = 'Description'; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
table 82570 "ADLSE Export Category" | ||
{ | ||
Caption = 'Export Category'; | ||
DataClassification = ToBeClassified; | ||
LookupPageId = "ADLSE Export Categories"; | ||
|
||
fields | ||
{ | ||
field(1; "Code"; Code[50]) | ||
{ | ||
Caption = 'Code'; | ||
DataClassification = CustomerContent; | ||
ToolTip = 'Specifies the Unique Code of a Export Category which can be linked to tables which are part of the export to Azure Datalake.'; | ||
} | ||
field(10; Description; Text[250]) | ||
{ | ||
Caption = 'Description'; | ||
DataClassification = CustomerContent; | ||
ToolTip = 'Specifies the Description of the Export Category.'; | ||
} | ||
} | ||
keys | ||
{ | ||
key(PK; "Code") | ||
{ | ||
Clustered = true; | ||
} | ||
} | ||
} | ||
|
149 changes: 149 additions & 0 deletions
149
businessCentral/app/src/ScheduleTaskAssignment.Report.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
report 82561 "ADLSE Schedule Task Assignment" | ||
{ | ||
ApplicationArea = Basic, Suite; | ||
Caption = 'Schedule Export'; | ||
ProcessingOnly = true; | ||
|
||
|
||
dataset | ||
{ | ||
dataitem(ADLSETable; "ADLSE Table") | ||
{ | ||
RequestFilterFields = ExportCategory; | ||
trigger OnPreDataItem() | ||
var | ||
ADLSEExecution: Codeunit "ADLSE Execution"; | ||
begin | ||
ADLSEExecution.StartExport(ADLSETable); | ||
end; | ||
} | ||
} | ||
requestpage | ||
{ | ||
SaveValues = true; | ||
layout | ||
{ | ||
area(Content) | ||
{ | ||
group(Options) | ||
{ | ||
Caption = 'Options'; | ||
field(JobQueueDescription; Description) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Description'; | ||
ToolTip = 'Specifies the description that is displayed in the job queue.'; | ||
} | ||
field(EarliestStartDateTimeControl; EarliestStartDateTime) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Earliest Start Date / Time '; | ||
ToolTip = 'Specifies the date and time when the job queue must be executed for the first time.'; | ||
} | ||
field(NoofMinutesBetweeenRuns; NoofMinutesBetweenRuns) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'No of minutes between runs'; | ||
ToolTip = 'Specifies the minimum number of minutes that are to elapse between runs of a job queue entry. The value cannot be less than one minute.'; | ||
} | ||
} | ||
|
||
group(Recurrence) | ||
{ | ||
grid(Daysgrid) | ||
{ | ||
Caption = 'Recurrence'; | ||
group(Recurrence1) | ||
{ | ||
ShowCaption = false; | ||
field(RunOnMondaysControl; RunOnMondays) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Run On Mondays'; | ||
ToolTip = 'Specifies that the job queue entry runs on Mondays.'; | ||
} | ||
field(RunOnTeusdaysControl; RunOnTeusdays) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Run On Tuesdays'; | ||
ToolTip = 'Specifies that the job queue entry runs on Teusdays.'; | ||
} | ||
field(RunOnWednesdayControl; RunOnWednesdays) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Run On Wednesdays'; | ||
ToolTip = 'Specifies that the job queue entry runs on Wednesdays.'; | ||
} | ||
field(RunOnThursdayControl; RunOnThursdays) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Run On Thursdays'; | ||
ToolTip = 'Specifies that the job queue entry runs on Thursdays.'; | ||
} | ||
} | ||
group(Recurrence2) | ||
{ | ||
ShowCaption = false; | ||
field(RunOnFridayControl; RunOnFridays) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Run On Fridays'; | ||
ToolTip = 'Specifies that the job queue entry runs on Fridays.'; | ||
} | ||
field(RunOnSaturdayControl; RunOnSaturdays) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Run On Saturdays'; | ||
ToolTip = 'Specifies that the job queue entry runs on Saturdays.'; | ||
} | ||
field(RunOnSundaysControl; RunOnSundays) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Run On Sundays'; | ||
ToolTip = 'Specifies that the job queue entry runs on Sundays.'; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
var | ||
Description: Text[30]; | ||
JobCategoryCodeTxt: Label 'ADLSE', Locked = true; | ||
EarliestStartDateTime: DateTime; | ||
NoofMinutesBetweenRuns: Integer; | ||
RunOnSundays: Boolean; | ||
RunOnMondays: Boolean; | ||
RunOnTeusdays: Boolean; | ||
RunOnWednesdays: Boolean; | ||
RunOnThursdays: Boolean; | ||
RunOnFridays: Boolean; | ||
RunOnSaturdays: Boolean; | ||
|
||
procedure CreateJobQueueEntry(var JobQueueEntry: Record "Job Queue Entry") | ||
var | ||
JobQueueCategory: Record "Job Queue Category"; | ||
begin | ||
Clear(JobQueueEntry); | ||
JobQueueCategory.InsertRec(JobCategoryCodeTxt, Description); | ||
JobQueueEntry.Init(); | ||
JobQueueEntry.Status := JobQueueEntry.Status::"On Hold"; | ||
JobQueueEntry.Description := Description; | ||
JobQueueEntry."No. of Minutes between Runs" := NoofMinutesBetweenRuns; | ||
JobQueueEntry."Run on Mondays" := RunOnMondays; | ||
JobQueueEntry."Run on Tuesdays" := RunOnTeusdays; | ||
JobQueueEntry."Run on Wednesdays" := RunOnWednesdays; | ||
JobQueueEntry."Run on Thursdays" := RunOnThursdays; | ||
JobQueueEntry."Run on Fridays" := RunOnFridays; | ||
JobQueueEntry."Run on Saturdays" := RunOnSaturdays; | ||
JobQueueEntry."Run on Sundays" := RunOnSundays; | ||
JobQueueEntry."Object Type to Run" := JobQueueEntry."Object Type to Run"::Report; | ||
JobQueueEntry."Object ID to Run" := Report::"ADLSE Schedule Task Assignment"; | ||
JobQueueEntry."Earliest Start Date/Time" := EarliestStartDateTime; | ||
JobQueueEntry."Report Output Type" := JobQueueEntry."Report Output Type"::"None (Processing only)"; | ||
JobQueueEntry.Insert(true); | ||
end; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.