mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
* knowledge(upgrade): upgrade code must not use ChangeCompany Addresses ADO bug 651092. Upgrade and feature data update code must run in the context of the company being upgraded; ChangeCompany leaves triggers, events and upgrade tags in the calling company and races the target company's own upgrade. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Address review: self-contained samples, fixture registration, scoped feature routing - Declare the sample table in both companions so each compiles on its own. - Register no-changecompany-in-upgrade and changecompany-runs-triggers-in-the-calling-company in review-fixtures.json. - Limit the Feature Data Update rule to UpdateData/AfterUpdate and their reachable helpers; read-only IsDataUpdateRequired/ReviewData preflight is permitted and shown as a clean control. - Add feature data update execution to al-upgrade-review applicability and not-applicable scope. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Clarify cross-company upgrade sequencing without race claims Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
41 lines
1.3 KiB
AL
41 lines
1.3 KiB
AL
table 50263 "Sales Order Ext"
|
|
{
|
|
DataClassification = CustomerContent;
|
|
|
|
fields
|
|
{
|
|
field(1; "No."; Code[20]) { }
|
|
field(2; "Shipping Agent Code"; Code[10]) { TableRelation = "Shipping Agent"; }
|
|
field(3; "Legacy Carrier Code"; Code[10]) { }
|
|
}
|
|
|
|
keys
|
|
{
|
|
key(PK; "No.") { Clustered = true; }
|
|
}
|
|
}
|
|
|
|
codeunit 50261 "Upgrade All Companies"
|
|
{
|
|
Subtype = Upgrade;
|
|
|
|
trigger OnUpgradePerDatabase()
|
|
var
|
|
Company: Record Company;
|
|
SalesOrderExt: Record "Sales Order Ext";
|
|
begin
|
|
// Reaches into every company from one session. Each company also has its own
|
|
// upgrade session, triggers and subscribers run in the calling context, and a
|
|
// data error in any company aborts the whole upgrade.
|
|
if Company.FindSet() then
|
|
repeat
|
|
SalesOrderExt.ChangeCompany(Company.Name);
|
|
SalesOrderExt.SetRange("Shipping Agent Code", '');
|
|
if SalesOrderExt.FindSet(true) then
|
|
repeat
|
|
SalesOrderExt.Validate("Shipping Agent Code", SalesOrderExt."Legacy Carrier Code");
|
|
SalesOrderExt.Modify(true);
|
|
until SalesOrderExt.Next() = 0;
|
|
until Company.Next() = 0;
|
|
end;
|
|
}
|