ALAppExtensions
ALAppExtensions copied to clipboard
[Event Request] page 9802 "Permission Sets" - OnBeforeImportPermissionSets
Hello, can you please add a new Event OnBeforeImportPermissionSets in page 9802 "Permission Sets" ?
action(ImportPermissionSets)
{
ApplicationArea = Basic, Suite;
Caption = 'Import Permission Sets';
Enabled = CanManageUsersOnTenant;
Image = Import;
ToolTip = 'Import a file with permissions.';
trigger OnAction()
var
PermissionSetBuffer: Record "Permission Set Buffer";
TempBlob: Codeunit "Temp Blob";
ImportPermissionSets: XmlPort "Import Permission Sets";
#if not CLEAN21
ImportTenantPermissionSets: XmlPort "Import Tenant Permission Sets";
#endif
FileName: Text;
InStream: InStream;
OutStream: OutStream;
UpdateExistingPermissions: Boolean;
Handled: Boolean;
begin
UploadIntoStream('Import', '', '', FileName, InStream);
TempBlob.CreateOutStream(OutStream);
CopyStream(OutStream, InStream);
TempBlob.CreateInStream(InStream);
OnBeforeImportPermissionSets(TempBlob, UpdateExistingPermissions, Handled);
if not Handled then
UpdateExistingPermissions := Confirm(UpdateExistingPermissionsLbl, true);
#if not CLEAN21
if IsImportNewVersion(InStream) then begin
ImportPermissionSets.SetSource(InStream);
ImportPermissionSets.SetUpdatePermissions(UpdateExistingPermissions);
ImportPermissionSets.Import();
end else begin
ImportTenantPermissionSets.SetSource(InStream);
ImportTenantPermissionSets.SetUpdatePermissions(UpdateExistingPermissions);
ImportTenantPermissionSets.Import();
end;
#else
ImportPermissionSets.SetSource(InStream);
ImportPermissionSets.SetUpdatePermissions(UpdateExistingPermissions);
ImportPermissionSets.Import();
#endif
PermissionSetBuffer := Rec;
Rec.FillRecordBuffer();
if Rec.Get(PermissionSetBuffer.Type, PermissionSetBuffer."Role ID") then;
end;
}
[IntegrationEvent(false, false)]
local procedure OnBeforeImportPermissionSets(TempBlob: Codeunit "Temp Blob"; var UpdateExistingPermissions: Boolean; var Handled: Boolean)
begin
end;
Hi @ReneZiel, what's the scenario behind wanting this event?
We would like to check the Permission Import File before.
After further discussion with the team, we've decided not to proceed with the email. It looks like a very specific case where using the event would allow you to skip the Confirm dialog.
The suggestion is to extend the page and add your own action that does that.