{"title":"Codeunit 4589 SOA Upgrade, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/4589-soa-upgrade/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":4589,"name":"SOA Upgrade","app":"Sales Order Agent","url":"https://jonas-paprotka.de/ref/codeunit/4589-soa-upgrade/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/4589-soa-upgrade/source/","path":"src/Apps/W1/SalesOrderAgent/app/src/Integration/SOAUpgrade.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:457":{"name":"Environment Information","url":"https://jonas-paprotka.de/ref/codeunit/457-environment-information/"},"codeunit:4400":{"name":"SOA Setup","url":"https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/"},"table:4325":{"name":"SOA Setup","url":"https://jonas-paprotka.de/ref/table/4325-soa-setup/"},"codeunit:9999":{"name":"Upgrade Tag","url":"https://jonas-paprotka.de/ref/codeunit/9999-upgrade-tag/"},"codeunit:4587":{"name":"SOA Impl","url":"https://jonas-paprotka.de/ref/codeunit/4587-soa-impl/"},"codeunit:7773":{"name":"Copilot Capability","url":"https://jonas-paprotka.de/ref/codeunit/7773-copilot-capability/"},"table:4593":{"name":"SOA KPI","url":"https://jonas-paprotka.de/ref/table/4593-soa-kpi/"},"table:4596":{"name":"SOA KPI Summary","url":"https://jonas-paprotka.de/ref/table/4596-soa-kpi-summary/"},"table:4589":{"name":"SOA Reply Attempt","url":"https://jonas-paprotka.de/ref/table/4589-soa-reply-attempt/"}},"procs":[{"name":"OnUpgradePerDatabase","line":31,"kind":"trigger","steps":[[33,"call","RegisterCapability",0],[34,"call","AddBillingTypeToCapability",0]]},{"name":"OnUpgradePerCompany","line":37,"kind":"trigger","steps":[[39,"call","AlwaysUpdateAgentInstructionsOnUpgrade",0],[40,"call","AddDailyEmailLimit",0],[41,"call","UpgradeUserSecurityIDField",0],[42,"call","SetMarkEmailAsRead",0],[43,"call","UpgradeOwnerUserSecurityID",0],[44,"call","UpgradeAgentIdentity",0],[45,"call","ResetReplyAttempts",0],[47,"call","UpgradeSOAKPIToPerAgent",0]]},{"name":"AlwaysUpdateAgentInstructionsOnUpgrade","line":54,"kind":"procedure","access":"local","params":0,"steps":[[62,"ext","codeunit",457,"IsSaaSInfrastructure",0],[77,"ext","codeunit",4400,"MustTreatAgentAsArchived",1],[79,"write",4325,"Insert"],[80,"call","TryUpdateAgentInstructions",2],[82,"write",4325,"DeleteAll"]]},{"name":"TryUpdateAgentInstructions","line":88,"kind":"procedure","access":"local","params":2,"steps":[[92,"ext","codeunit",4400,"UpdateInstructions",1],[96,"write",4325,"Modify"]]},{"name":"RegisterCapability","line":100,"kind":"procedure","access":"local","params":0,"steps":[[104,"ext","codeunit",9999,"HasUpgradeTag",1],[104,"call","GetRegisterSalesOrderAgentCapabilityTag",0],[105,"ext","codeunit",4587,"RegisterCapability",0],[107,"ext","codeunit",9999,"SetUpgradeTag",1],[107,"call","GetRegisterSalesOrderAgentCapabilityTag",0]]},{"name":"AddBillingTypeToCapability","line":111,"kind":"procedure","access":"local","params":0,"steps":[[118,"ext","codeunit",9999,"HasUpgradeTag",1],[118,"call","GetAddBillingTypeToSOACapabilityTag",0],[119,"ext","codeunit",457,"IsSaaSInfrastructure",0],[120,"ext","codeunit",7773,"IsCapabilityRegistered",1],[121,"ext","codeunit",7773,"ModifyCapability",4],[123,"ext","codeunit",9999,"SetUpgradeTag",1],[123,"call","GetAddBillingTypeToSOACapabilityTag",0]]},{"name":"UpgradeUserSecurityIDField","line":127,"kind":"procedure","access":"local","params":0,"steps":[[133,"ext","codeunit",9999,"HasUpgradeTag",1],[133,"call","GetUserSecurityIDUpgradeTag",0],[139,"ext","codeunit",9999,"SetUpgradeTag",1],[139,"call","GetUserSecurityIDUpgradeTag",0]]},{"name":"AddDailyEmailLimit","line":142,"kind":"procedure","access":"local","params":0,"steps":[[147,"ext","codeunit",9999,"HasUpgradeTag",1],[147,"call","GetSetDailyEmailLimitTag",0],[151,"ext","table",4325,"GetDefaultMessageLimit",0],[152,"write",4325,"Modify"],[155,"ext","codeunit",9999,"SetUpgradeTag",1],[155,"call","GetSetDailyEmailLimitTag",0]]},{"name":"SetMarkEmailAsRead","line":159,"kind":"procedure","access":"local","params":0,"steps":[[164,"ext","codeunit",9999,"HasUpgradeTag",1],[164,"call","GetSetMarkEmailAsReadTag",0],[169,"write",4325,"Modify"],[172,"ext","codeunit",9999,"SetUpgradeTag",1],[172,"call","GetSetMarkEmailAsReadTag",0]]},{"name":"UpgradeAgentIdentity","line":176,"kind":"procedure","access":"local","params":0,"steps":[[184,"ext","codeunit",9999,"HasUpgradeTag",1],[184,"call","GetAgentIdentityTag",0],[198,"ext","codeunit",4400,"MustTreatAgentAsArchived",1],[202,"ext","codeunit",4400,"GetSOAUserDisplayName",0],[207,"ext","codeunit",4400,"GetInitials",0],[212,"write",4325,"Modify"],[216,"ext","codeunit",9999,"SetUpgradeTag",1],[216,"call","GetAgentIdentityTag",0]]},{"name":"UpgradeOwnerUserSecurityID","line":219,"kind":"procedure","access":"local","params":0,"steps":[[225,"ext","codeunit",9999,"HasUpgradeTag",1],[225,"call","GetOwnerUserSecurityIDTag",0],[237,"write",4325,"Modify"],[240,"ext","codeunit",9999,"SetUpgradeTag",1],[240,"call","GetOwnerUserSecurityIDTag",0]]},{"name":"UpgradeSOAKPIToPerAgent","line":244,"kind":"procedure","access":"local","params":0,"steps":[[254,"ext","codeunit",9999,"HasUpgradeTag",1],[254,"call","GetSOAKPIPerAgentTag",0],[258,"ext","codeunit",9999,"SetUpgradeTag",1],[258,"call","GetSOAKPIPerAgentTag",0],[265,"ext","codeunit",4400,"FindFirstNonArchivedSetup",1],[276,"call","MergeSOAKPIIntoSummary",3],[280,"call","MergeSOAKPIIntoSummary",3],[286,"write",4593,"DeleteAll"],[288,"ext","codeunit",9999,"SetUpgradeTag",1],[288,"call","GetSOAKPIPerAgentTag",0]]},{"name":"MergeSOAKPIIntoSummary","line":291,"kind":"procedure","access":"local","params":3,"steps":[[293,"ext","table",4596,"GetSafe",1],[303,"write",4596,"Modify"]]},{"name":"ResetReplyAttempts","line":310,"kind":"procedure","access":"local","params":0,"steps":[[315,"ext","codeunit",9999,"HasUpgradeTag",1],[315,"call","GetResetReplyAttemptsTag",0],[318,"write",4589,"DeleteAll"],[320,"ext","codeunit",9999,"SetUpgradeTag",1],[320,"call","GetResetReplyAttemptsTag",0]]},{"name":"RegisterPerDatabaseUpgradeTags","line":371,"kind":"procedure","access":"local","params":1,"steps":[[373,"call","GetAddBillingTypeToSOACapabilityTag",0]]},{"name":"RegisterPerCompanyUpgradeTags","line":377,"kind":"procedure","access":"local","params":1,"steps":[[379,"call","GetSetDailyEmailLimitTag",0],[380,"call","GetSetMarkEmailAsReadTag",0],[381,"call","GetOwnerUserSecurityIDTag",0],[382,"call","GetAgentIdentityTag",0],[383,"call","GetResetReplyAttemptsTag",0],[385,"call","GetSOAKPIPerAgentTag",0]]}]}