I’m facing an issue while trying to programmatically create a profile by copying the "RAPIDSTART SERVICES" profile into a new one.
I get this exception:
Exception of type 'Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLDialogException' was thrown.
Stack trace:
"Conf./Personalization Mgt." (CodeUnit 9170).CopyProfileWithUserInput
line 5 - Base Application version 27.1.41698.42312
var
profileNewRec: Record "All Profile";
profileSrcRec: Record "All Profile";
ConfPersonalizationMgt: Codeunit "Conf./Personalization Mgt.";
begin
profileSrcRec.Reset();
profileSrcRec.SetRange("Profile ID", 'RAPIDSTART SERVICES');
if profileSrcRec.FindFirst() then begin
ConfPersonalizationMgt.CopyProfileWithUserInput(profileSrcRec, profileNewRec);
if profileNewRec.Get(profileNewRec.Scope, profileNewRec."App ID", profileNewRec."Profile ID") then begin
Message('Profile %1 created successfully.', profileNewRec."Profile ID");
end;
end;
end;
What I suspect
It seems the method CopyProfileWithUserInput internally tries to open a dialog or confirmation page — which cannot run in background or non-UI contexts → resulting in NavNCLDialogException.
My question
Has anyone successfully used this method from AL code without triggering a dialog?
Is there an alternative to copy a profile silently, without UI interaction?
(For example: using CopyProfile()
Any insights would be greatly appreciated!


Report
All responses (
Answers (