Skip to content

Commit 65f76c1

Browse files
GP Added Serial/Lot information to Historical Snapshot for Sales and Inventory transactions (#26422)
This change enhances the GP migration to include serial and lot detail to the historical snapshot. Fixes [AB#534934](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/534934) --------- Co-authored-by: jaymckinney <[email protected]>
1 parent 38cfe27 commit 65f76c1

14 files changed

+885
-36
lines changed

Apps/W1/DynamicsGPHistoricalData/app/Permissions/GPHistoricalTrx.permissionset.al

+59-22
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,64 @@ permissionset 40900 "GP Historical Trx."
55
Assignable = true;
66
Access = Public;
77
Caption = 'GP Historical Transactions';
8-
98
Permissions = page "Hist. Gen. Journal Lines" = X,
10-
page "Hist. G/L Account List" = X,
11-
page "Hist. Inventory Trx." = X,
12-
page "Hist. Inventory Trx. Headers" = X,
13-
page "Hist. Inventory Trx. Lines" = X,
14-
page "Hist. Payables Document" = X,
15-
page "Hist. Payables Documents" = X,
16-
page "Hist. Purchase Recv." = X,
17-
page "Hist. Purchase Recv. Headers" = X,
18-
page "Hist. Purchase Recv. Lines" = X,
19-
page "Hist. Receivables Document" = X,
20-
page "Hist. Receivables Documents" = X,
21-
page "Hist. Sales Trx." = X,
22-
page "Hist. Sales Trx. Headers" = X,
23-
page "Hist. Sales Trx. Lines" = X,
24-
page "Hist. Migration Step Status" = X,
25-
page "Hist. Payables Apply" = X,
26-
page "Hist. Payables Apply List" = X,
27-
page "Hist. Payables Document List" = X,
28-
page "Hist. Receivables Apply" = X,
29-
page "Hist. Receivables Apply List" = X,
30-
page "Hist. Recv. Document List" = X;
9+
page "Hist. G/L Account List" = X,
10+
page "Hist. Inventory Trx." = X,
11+
page "Hist. Inventory Trx. Headers" = X,
12+
page "Hist. Inventory Trx. Lines" = X,
13+
page "Hist. Payables Document" = X,
14+
page "Hist. Payables Documents" = X,
15+
page "Hist. Purchase Recv." = X,
16+
page "Hist. Purchase Recv. Headers" = X,
17+
page "Hist. Purchase Recv. Lines" = X,
18+
page "Hist. Receivables Document" = X,
19+
page "Hist. Receivables Documents" = X,
20+
page "Hist. Sales Trx." = X,
21+
page "Hist. Sales Trx. Headers" = X,
22+
page "Hist. Sales Trx. Lines" = X,
23+
page "Hist. Migration Step Status" = X,
24+
page "Hist. Payables Apply" = X,
25+
page "Hist. Payables Apply List" = X,
26+
page "Hist. Payables Document List" = X,
27+
page "Hist. Receivables Apply" = X,
28+
page "Hist. Receivables Apply List" = X,
29+
page "Hist. Recv. Document List" = X,
30+
tabledata "Hist. G/L Account" = RIMD,
31+
tabledata "Hist. Gen. Journal Line" = RIMD,
32+
tabledata "Hist. Inventory Trx. Header" = RIMD,
33+
tabledata "Hist. Inventory Trx. Line" = RIMD,
34+
tabledata "Hist. Invt. Trx. SerialLot" = RIMD,
35+
tabledata "Hist. Migration Current Status" = RIMD,
36+
tabledata "Hist. Migration Step Status" = RIMD,
37+
tabledata "Hist. Payables Apply" = RIMD,
38+
tabledata "Hist. Payables Document" = RIMD,
39+
tabledata "Hist. Purchase Recv. Header" = RIMD,
40+
tabledata "Hist. Purchase Recv. Line" = RIMD,
41+
tabledata "Hist. Receivables Apply" = RIMD,
42+
tabledata "Hist. Receivables Document" = RIMD,
43+
tabledata "Hist. Recv. Trx. SerialLot" = RIMD,
44+
tabledata "Hist. Sales Trx. Header" = RIMD,
45+
tabledata "Hist. Sales Trx. Line" = RIMD,
46+
table "Hist. G/L Account" = X,
47+
table "Hist. Gen. Journal Line" = X,
48+
table "Hist. Inventory Trx. Header" = X,
49+
table "Hist. Inventory Trx. Line" = X,
50+
table "Hist. Invt. Trx. SerialLot" = X,
51+
table "Hist. Migration Current Status" = X,
52+
table "Hist. Migration Step Status" = X,
53+
table "Hist. Payables Apply" = X,
54+
table "Hist. Payables Document" = X,
55+
table "Hist. Purchase Recv. Header" = X,
56+
table "Hist. Purchase Recv. Line" = X,
57+
table "Hist. Receivables Apply" = X,
58+
table "Hist. Receivables Document" = X,
59+
table "Hist. Recv. Trx. SerialLot" = X,
60+
table "Hist. Sales Trx. Header" = X,
61+
table "Hist. Sales Trx. Line" = X,
62+
codeunit "Hist. Migration Status Mgmt." = X,
63+
codeunit "Hist. Page Navigation Handler" = X,
64+
page "Hist. Invt. Trx. SerialLot" = X,
65+
page "Hist. Invt. Trx. SerlLot. List" = X,
66+
page "Hist. Recv. Trx. SerialLot" = X,
67+
page "Hist. Recv. Trx. SerlLot. List" = X;
3168
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace Microsoft.DataMigration.GP.HistoricalData;
2+
3+
using System.Security.AccessControl;
4+
5+
permissionsetextension 40901 "D365 Full Access Ext." extends "D365 FULL ACCESS"
6+
{
7+
Permissions = tabledata "Hist. Gen. Journal Line" = RIMD,
8+
tabledata "Hist. G/L Account" = RIMD,
9+
tabledata "Hist. Sales Trx. Header" = RIMD,
10+
tabledata "Hist. Sales Trx. Line" = RIMD,
11+
tabledata "Hist. Receivables Document" = RIMD,
12+
tabledata "Hist. Payables Document" = RIMD,
13+
tabledata "Hist. Inventory Trx. Header" = RIMD,
14+
tabledata "Hist. Inventory Trx. Line" = RIMD,
15+
tabledata "Hist. Purchase Recv. Header" = RIMD,
16+
tabledata "Hist. Purchase Recv. Line" = RIMD,
17+
tabledata "Hist. Migration Step Status" = RIMD,
18+
tabledata "Hist. Migration Current Status" = RIMD,
19+
tabledata "Hist. Payables Apply" = RIMD,
20+
tabledata "Hist. Receivables Apply" = RIMD,
21+
tabledata "Hist. Invt. Trx. SerialLot" = RIMD,
22+
tabledata "Hist. Recv. Trx. SerialLot" = RIMD;
23+
}

Apps/W1/DynamicsGPHistoricalData/app/Permissions/d365basicext.permissionsetext.al

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ permissionsetextension 40900 "D365 Basic Ext." extends "D365 BASIC"
1717
tabledata "Hist. Migration Step Status" = R,
1818
tabledata "Hist. Migration Current Status" = R,
1919
tabledata "Hist. Payables Apply" = R,
20-
tabledata "Hist. Receivables Apply" = R;
20+
tabledata "Hist. Receivables Apply" = R,
21+
tabledata "Hist. Invt. Trx. SerialLot" = R,
22+
tabledata "Hist. Recv. Trx. SerialLot" = R;
2123
}

Apps/W1/DynamicsGPHistoricalData/app/src/Codeunits/HistMigrationStatusMgmt.Codeunit.al

+16
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,25 @@ codeunit 40902 "Hist. Migration Status Mgmt."
8686
HistInventoryTrxLine: Record "Hist. Inventory Trx. Line";
8787
HistPurchaseRecvHeader: Record "Hist. Purchase Recv. Header";
8888
HistPurchaseRecvLine: Record "Hist. Purchase Recv. Line";
89+
HistPayablesApply: Record "Hist. Payables Apply";
90+
HistReceivablesApply: Record "Hist. Receivables Apply";
91+
HistInvtTrxSerialLot: Record "Hist. Invt. Trx. SerialLot";
92+
HistRecvTrxSerialLot: Record "Hist. Recv. Trx. SerialLot";
8993
begin
9094
UpdateStepStatus("Hist. Migration Step Type"::"Resetting Data", false);
9195

96+
if not HistRecvTrxSerialLot.IsEmpty() then
97+
BatchDeleteAll(Database::"Hist. Recv. Trx. SerialLot", HistRecvTrxSerialLot.FieldNo(HistRecvTrxSerialLot."Primary Key"));
98+
99+
if not HistInvtTrxSerialLot.IsEmpty() then
100+
BatchDeleteAll(Database::"Hist. Invt. Trx. SerialLot", HistInvtTrxSerialLot.FieldNo(HistInvtTrxSerialLot."Primary Key"));
101+
102+
if not HistReceivablesApply.IsEmpty() then
103+
BatchDeleteAll(Database::"Hist. Receivables Apply", HistReceivablesApply.FieldNo(HistReceivablesApply."Primary Key"));
104+
105+
if not HistPayablesApply.IsEmpty() then
106+
BatchDeleteAll(Database::"Hist. Payables Apply", HistPayablesApply.FieldNo(HistPayablesApply."Primary Key"));
107+
92108
if not HistPurchaseRecvLine.IsEmpty() then
93109
BatchDeleteAll(Database::"Hist. Purchase Recv. Line", HistPurchaseRecvLine.FieldNo(HistPurchaseRecvLine."Primary Key"));
94110

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Microsoft.DataMigration.GP.HistoricalData;
2+
3+
enum 40908 "Hist. Inventory Qty. Type"
4+
{
5+
value(0; Unknown) { Caption = 'Unknown'; }
6+
value(1; "On Hand") { Caption = 'On Hand'; }
7+
value(2; Returned) { Caption = 'Returned'; }
8+
value(3; "In Use") { Caption = 'In Use'; }
9+
value(4; "In Service") { Caption = 'In Service'; }
10+
value(5; Damaged) { Caption = 'Damaged'; }
11+
}

Apps/W1/DynamicsGPHistoricalData/app/src/Pages/HistInventoryTrxLines.Page.al

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ namespace Microsoft.DataMigration.GP.HistoricalData;
22

33
page 41011 "Hist. Inventory Trx. Lines"
44
{
5+
ApplicationArea = All;
6+
UsageCategory = None;
57
Caption = 'Historical Inventory Trx. Lines';
68
PageType = ListPart;
79
Editable = false;
@@ -36,6 +38,14 @@ page 41011 "Hist. Inventory Trx. Lines"
3638
{
3739
ApplicationArea = All;
3840
ToolTip = 'Specifies the value of the Quantity field.';
41+
42+
trigger OnDrillDown()
43+
var
44+
HistInvtTrxSerlLotList: Page "Hist. Invt. Trx. SerlLot. List";
45+
begin
46+
HistInvtTrxSerlLotList.SetFilterInventoryTrxLine(Rec);
47+
HistInvtTrxSerlLotList.Run();
48+
end;
3949
}
4050
field("Unit Cost"; Rec."Unit Cost")
4151
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
namespace Microsoft.DataMigration.GP.HistoricalData;
2+
3+
page 41029 "Hist. Invt. Trx. SerialLot"
4+
{
5+
Caption = 'Historical Inventory Transaction Serial/Lot Detail';
6+
PageType = Card;
7+
ApplicationArea = All;
8+
UsageCategory = None;
9+
Editable = false;
10+
DeleteAllowed = false;
11+
InsertAllowed = false;
12+
ModifyAllowed = false;
13+
SourceTable = "Hist. Invt. Trx. SerialLot";
14+
DataCaptionExpression = DataCaptionExpressionTxt;
15+
16+
layout
17+
{
18+
area(content)
19+
{
20+
group(General)
21+
{
22+
Caption = 'General';
23+
24+
field("Serial/Lot Number"; Rec."Serial/Lot Number")
25+
{
26+
ToolTip = 'Specifies the value of the Serial/Lot Number field.';
27+
}
28+
field("Serial/Lot Qty."; Rec."Serial/Lot Qty.")
29+
{
30+
ToolTip = 'Specifies the value of the Serial/Lot Qty. field.';
31+
}
32+
field("Item No."; Rec."Item No.")
33+
{
34+
ToolTip = 'Specifies the value of the Item No. field.';
35+
}
36+
field("Document No."; Rec."Document No.")
37+
{
38+
ToolTip = 'Specifies the value of the Document No. field.';
39+
}
40+
field("Document Type"; Rec."Document Type")
41+
{
42+
ToolTip = 'Specifies the value of the Document Type field.';
43+
}
44+
field("Line Sequence Number"; Rec."Line Sequence Number")
45+
{
46+
ToolTip = 'Specifies the value of the Line Sequence Number field.';
47+
}
48+
field("Serial/Lot Seq. Number"; Rec."Serial/Lot Seq. Number")
49+
{
50+
ToolTip = 'Specifies the value of the Serial/Lot Seq. Number field.';
51+
}
52+
field("From Bin"; Rec."From Bin")
53+
{
54+
ToolTip = 'Specifies the value of the From Bin field.';
55+
}
56+
field("To Bin"; Rec."To Bin")
57+
{
58+
ToolTip = 'Specifies the value of the To Bin field.';
59+
}
60+
field("Manufacture Date"; Rec."Manufacture Date")
61+
{
62+
ToolTip = 'Specifies the value of the Manufacture Date field.';
63+
}
64+
field("Expiration Date"; Rec."Expiration Date")
65+
{
66+
ToolTip = 'Specifies the value of the Expiration Date field.';
67+
}
68+
field("Audit Code"; Rec."Audit Code")
69+
{
70+
ToolTip = 'Specifies the value of the Audit Code field.';
71+
}
72+
}
73+
}
74+
}
75+
76+
trigger OnAfterGetCurrRecord()
77+
begin
78+
DataCaptionExpressionTxt := Rec."Item No." + ' - ' + Rec."Serial/Lot Number";
79+
end;
80+
81+
var
82+
DataCaptionExpressionTxt: Text;
83+
}

0 commit comments

Comments
 (0)