We have a client (SaaS) that would like to have the Microsoft 365 User Account state that is currently on the User Card page also displayed on the Users page
The value is not stored in a field but is calculated in the OnAfterGetRecord trigger by calling the IsGraphUserAccountEnabled procedure of the Azure AD Graph Codeunit
Microsoft365State := Microsoft365State::Inactive;
if Rec."Authentication Email" <> '' then
if AzureADGraph.IsGraphUserAccountEnabled(Rec."Authentication Email", IsGraphUserAccountEnabled) and IsGraphUserAccountEnabled then
Microsoft365State := Microsoft365State::Active
That procedure has a scope of OnPrem
/// <summary>
/// Checks if the Microsoft 365 user account for the specified principal name is enabled.
/// Note: Even if the graph user is enabled, the account may be disabled in Business Central.
/// </summary>
/// <param name="UserPrincipalName">The user principal name.</param>
[Scope('OnPrem')]
[TryFunction]
[NonDebuggable]
procedure IsGraphUserAccountEnabled(UserPrincipalName: Text; var IsEnabled: Boolean)
begin
AzureADGraphImpl.IsGraphUserAccountEnabled(UserPrincipalName, IsEnabled);
end;
I can't duplicate the logic on the Users list since they are on SaaS
Any idea on how I can accomplish this request?