Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4cb42fc
Initial plan
Copilot Sep 21, 2026
1363897
Add sell-to flowfields for production analysis
Copilot Sep 21, 2026
ddb271d
Populate production analysis sell-to fields safely
Copilot Sep 21, 2026
5cc846b
Refine production analysis order uniqueness check
Copilot Sep 21, 2026
791898c
Optimize sell-to case uniqueness detection
Copilot Sep 21, 2026
989f8da
Guard production analysis sell-to sync on order changes
Copilot Sep 21, 2026
15555ce
Refresh sell-to sync on production analysis edits
Copilot Sep 21, 2026
e49da30
Gate install backfill and tighten case lookup
Copilot Sep 21, 2026
ae7388b
Simplify sell-to unique case lookup
Copilot Sep 21, 2026
f6274dc
Always resync production analysis sell-to fields
Copilot Sep 21, 2026
1bf86f3
Make sell-to sync order-driven on production analysis
Copilot Sep 21, 2026
4f8ca06
Persist sell-to sync after order validation
Copilot Sep 21, 2026
ce96a85
Sync production analysis sell-to values on write
Copilot Sep 21, 2026
00926ab
Split sell-to sync between validate and modify
Copilot Sep 21, 2026
308f81c
Remove modify-time sell-to resync path
Copilot Sep 21, 2026
7ce55df
Move sell-to sync into order validation trigger
Copilot Sep 21, 2026
eee92b8
Enable automatic production analysis insert subscriber
Copilot Sep 21, 2026
e3b9f0d
Move sell-to sync into table extension triggers
Copilot Sep 21, 2026
21d9c22
Limit sell-to sync to insert and order validation
Copilot Sep 21, 2026
41024f0
Optimize production analysis sell-to backfills
Copilot Sep 21, 2026
dfe935f
Restore insert subscriber and persist order validate sync
Copilot Sep 21, 2026
7587d01
Relax backfill locks and keep validate sync in memory
Copilot Sep 21, 2026
93a59e6
Fix AL tableextension field modify scope
Copilot Sep 22, 2026
421a60d
Handle consistent sell-to duplicates
Copilot Sep 22, 2026
024a6a1
Respect AL trigger flow for sell-to sync
Copilot Sep 22, 2026
f5c1d27
Use standard modify path for sell-to backfill
Copilot Sep 22, 2026
4e69f5b
Limit sell-to modify sync to order changes
Copilot Sep 22, 2026
42d9324
Persist sell-to updates from order validation
Copilot Sep 22, 2026
46309ca
Track order changes through AL validation flow
Copilot Sep 22, 2026
3311600
Compare order changes against persisted record
Copilot Sep 22, 2026
a3fcce2
Update version number to 28.1.2.9
PropmanProphecy Sep 22, 2026
29a5496
Downgrade PrintVis version to 28.1.2.8
PropmanProphecy Sep 22, 2026
04ab795
Update publisher name in app.json
PropmanProphecy Sep 22, 2026
883b1f3
Update app.json
PropmanProphecy Sep 22, 2026
783bb9b
Update app.json description field
PropmanProphecy Sep 22, 2026
9225fd0
Remove description from app.json
PropmanProphecy Sep 22, 2026
82df37f
Update app.json description field
PropmanProphecy Sep 22, 2026
4ef39a5
Update description field in app.json
PropmanProphecy Sep 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Prototyping/PVSProductionAnalysisInstall.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
codeunit 50102 "PVS Prod. Analysis Install"
{
Subtype = Install;

trigger OnInstallAppPerCompany()
var
AppInfo: ModuleInfo;
begin
NavApp.GetCurrentModuleInfo(AppInfo);
if AppInfo.DataVersion() <> Version.Create('0.0.0.0') then
exit;

BackfillSellToFields();
end;

local procedure BackfillSellToFields()
var
ProductionAnalysis: Record "PrintVis Production Analysis";
ProductionAnalysisSellTo: Codeunit "PVS Prod. Analysis SellTo";
begin
if not ProductionAnalysis.FindSet() then
exit;

repeat
if ProductionAnalysisSellTo.SyncSellToFields(ProductionAnalysis) then
ProductionAnalysis.Modify(false);
until ProductionAnalysis.Next() = 0;
end;
}
85 changes: 85 additions & 0 deletions Prototyping/PVSProductionAnalysisSellTo.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
codeunit 50101 "PVS Prod. Analysis SellTo"
{
EventSubscriberInstance = StaticAutomatic;

[EventSubscriber(ObjectType::Table, Database::"PrintVis Production Analysis", 'OnBeforeInsertEvent', '', false, false)]
local procedure OnBeforeInsertProductionAnalysis(var Rec: Record "PrintVis Production Analysis"; RunTrigger: Boolean)
begin
if not RunTrigger then
exit;

ApplySellToFields(Rec);
end;

[EventSubscriber(ObjectType::Table, Database::"PrintVis Production Analysis", 'OnBeforeModifyEvent', '', false, false)]
local procedure OnBeforeModifyProductionAnalysis(var Rec: Record "PrintVis Production Analysis"; var xRec: Record "PrintVis Production Analysis"; RunTrigger: Boolean)
begin
if not RunTrigger then
exit;

if not OrderNoChanged(Rec) then
exit;

ApplySellToFields(Rec);
end;

procedure ApplySellToFields(var ProductionAnalysis: Record "PrintVis Production Analysis")
begin
SyncSellToFields(ProductionAnalysis);
end;

procedure SyncSellToFields(var ProductionAnalysis: Record "PrintVis Production Analysis"): Boolean
var
PVSCase: Record "PVS Case";
SellToNo: Code[20];
SellToName: Text[100];
begin
if FindUniqueCaseByOrderNo(ProductionAnalysis."PrintVis Order No.", PVSCase) then begin
SellToNo := PVSCase."Sell-To No.";
SellToName := PVSCase."Sell-To Name";
end;

if (ProductionAnalysis."Sell-to No." = SellToNo) and (ProductionAnalysis."Sell-to Name" = SellToName) then
exit(false);

ProductionAnalysis."Sell-to No." := SellToNo;
ProductionAnalysis."Sell-to Name" := SellToName;
exit(true);
end;

local procedure FindUniqueCaseByOrderNo(PrintVisOrderNo: Code[20]; var PVSCase: Record "PVS Case"): Boolean
var
FirstPVSCase: Record "PVS Case";
SellToNo: Code[20];
SellToName: Text[100];
begin
if PrintVisOrderNo = '' then
exit(false);

PVSCase.SetCurrentKey("Order No.");
PVSCase.SetRange("Order No.", PrintVisOrderNo);
if not PVSCase.FindFirst() then
exit(false);

FirstPVSCase := PVSCase;
SellToNo := PVSCase."Sell-To No.";
SellToName := PVSCase."Sell-To Name";

while PVSCase.Next() <> 0 do
if (PVSCase."Sell-To No." <> SellToNo) or (PVSCase."Sell-To Name" <> SellToName) then
exit(false);

PVSCase := FirstPVSCase;
exit(true);
end;

local procedure OrderNoChanged(ProductionAnalysis: Record "PrintVis Production Analysis"): Boolean
var
PersistedProductionAnalysis: Record "PrintVis Production Analysis";
PersistedProductionAnalysisRef: RecordRef;
begin
PersistedProductionAnalysisRef.Get(ProductionAnalysis.RecordId);
PersistedProductionAnalysisRef.SetTable(PersistedProductionAnalysis);
exit(ProductionAnalysis."PrintVis Order No." <> PersistedProductionAnalysis."PrintVis Order No.");
end;
}
27 changes: 27 additions & 0 deletions Prototyping/PVSProductionAnalysisSellTo.TableExt.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
tableextension 50100 "PVS Production Analysis SellTo" extends "PrintVis Production Analysis"
{
fields
{
field(50100; "Sell-to No."; Code[20])
{
Caption = 'Sell-to No.';
DataClassification = CustomerContent;
Editable = false;
}
field(50101; "Sell-to Name"; Text[100])
{
Caption = 'Sell-to Name';
DataClassification = CustomerContent;
Editable = false;
}
modify("PrintVis Order No.")
{
trigger OnAfterValidate()
var
ProductionAnalysisSellTo: Codeunit "PVS Prod. Analysis SellTo";
begin
ProductionAnalysisSellTo.ApplySellToFields(Rec);
end;
}
}
}
23 changes: 23 additions & 0 deletions Prototyping/PVSProductionAnalysisUpgrade.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
codeunit 50103 "PVS Prod. Analysis Upgrade"
{
Subtype = Upgrade;

trigger OnUpgradePerCompany()
begin
BackfillSellToFields();
end;

local procedure BackfillSellToFields()
var
ProductionAnalysis: Record "PrintVis Production Analysis";
ProductionAnalysisSellTo: Codeunit "PVS Prod. Analysis SellTo";
begin
if not ProductionAnalysis.FindSet() then
exit;

repeat
if ProductionAnalysisSellTo.SyncSellToFields(ProductionAnalysis) then
ProductionAnalysis.Modify(false);
until ProductionAnalysis.Next() = 0;
end;
}
6 changes: 3 additions & 3 deletions Prototyping/app.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "b7d23e82-11ae-4172-9289-6e9584df4759",
"name": "Prototyping",
"publisher": "PrintVis",
"version": "1.0.0.0",
"publisher": "PrintVis A/S",
"version": "1.0.0.1",
"brief": "",
"description": "",
"privacyStatement": "",
Expand All @@ -15,7 +15,7 @@
"id": "5452f323-059e-499a-9753-5d2c07eef904",
"name": "PrintVis",
"publisher": "PrintVis A/S",
"version": "28.0.0.0"
"version": "28.1.2.9"
}
],
"screenshots": [],
Expand Down
Loading