-
Notifications
You must be signed in to change notification settings - Fork 443
[Agent Archiving] Payables and Expense agent implementation for IAgentArchiving #10460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
77e7e9c
43e74c7
a0b08e5
2d90809
83116b9
1ad61a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
|
|
||
| namespace Microsoft.Agent.PayablesAgent; | ||
|
|
||
| using System.Agents; | ||
|
|
||
| codeunit 3319 "PA Agent Archiving" implements IAgentArchiving | ||
| { | ||
| Access = Internal; | ||
| InherentEntitlements = X; | ||
| InherentPermissions = X; | ||
|
|
||
| procedure IsArchivingSupported(): Boolean | ||
| begin | ||
| exit(false); | ||
| end; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,13 +66,28 @@ codeunit 4301 "Agent Impl." | |
| if Agent.Substate = Agent.Substate::Archived then | ||
| exit; // Archiving is terminal; idempotent no-op avoids the platform "archived agent cannot be modified" error on re-archive. | ||
|
|
||
| if not IsArchivingSupported(Agent) then | ||
|
krupybalu marked this conversation as resolved.
|
||
| Error(ArchivingNotSupportedErr); | ||
|
|
||
| if Agent.State <> Agent.State::Disabled then | ||
| Error(DeactivateBeforeArchivingErr); | ||
|
|
||
| Agent.Substate := Agent.Substate::Archived; | ||
| Agent.Modify(true); | ||
| end; | ||
|
|
||
| procedure IsArchivingSupported(Agent: Record Agent): Boolean | ||
|
krupybalu marked this conversation as resolved.
Outdated
|
||
| var | ||
| AgentArchiving: Interface IAgentArchiving; | ||
| begin | ||
| if IsNullGuid(Agent."User Security ID") then | ||
| exit(false); | ||
|
|
||
| AgentArchiving := Agent."Agent Metadata Provider"; | ||
|
krupybalu marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AgentImpl.IsArchivingSupported(Agent) (local overload) does Agent judgement — not directly backed by a BCQuality knowledge article. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.35.4 |
||
|
|
||
| exit(AgentArchiving.IsArchivingSupported()); | ||
| end; | ||
|
|
||
| procedure IsArchived(AgentUserSecurityID: Guid): Boolean | ||
| var | ||
| Agent: Record Agent; | ||
|
|
@@ -628,6 +643,7 @@ codeunit 4301 "Agent Impl." | |
| AgentDoesNotExistErr: Label 'Agent does not exist.'; | ||
| AgentArchivedCannotBeModifiedErr: Label 'The agent is archived and cannot be modified.'; | ||
| DeactivateBeforeArchivingErr: Label 'Deactivate the agent before archiving it.'; | ||
| ArchivingNotSupportedErr: Label 'This type of agent cannot be archived yet.'; | ||
|
krupybalu marked this conversation as resolved.
Outdated
|
||
| AutoLbl: Label 'Auto'; | ||
| NoActiveAgentsErr: Label 'There are no active agents setup on the system.'; | ||
| NoAgentsAvailableNotificationLbl: Label 'Business Central agents are currently not available in your country.'; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.