Announcements
No record found.
Hello everyone,
I’m working on Business Central v27 (cloud), and I’m trying to create a custom profile programmatically from the existing ‘RAPIDSTART SERVICES’ profile using an Install Codeunit.
Here’s the code I’m using:
When I run this, I get the following error:
The profile with the ID 'IFTAM' and AppId '{xxxx-xxx-xx-xxx}' cannot be created, because the specified AppId is different from the empty GUID.
You’re getting that error because you’re inserting a new record with the same non-empty AppId as the source profile (“RAPIDSTART SERVICES” comes from the Base App). Business Central won’t let your extension create a profile that is “owned” by another app. Profiles you create at runtime must be tenant customizations → i.e., the App ID must be empty (all zeros) and “Published As” must be Tenant Customization.
Read from All Profile, insert into Profile and clear the app fields
Use “All Profile” only to read an existing profile (it’s a union over app/tenant profiles).
Insert the new record into “Profile” (the insertable table).
Clearing "App ID" (and related fields) and setting "Published As" is what resolves the error.
"App ID"
"Published As"
Hi Gregory Mavrogeorgis,
I tried adapting your suggestion, but since the "All Profile" table has three primary keys, the Get didn’t retrieve the record, so I used Reset() and SetRange() to get the source profile instead.
"All Profile"
Get
Reset()
SetRange()
Here’s the adjusted part I used:
procedure createProfile() var profileNewRec: record "All Profile"; profileSrcRec: record "All Profile"; begin profileSrcRec.Reset(); profileSrcRec.SetRange("Profile ID", 'RAPIDSTART SERVICES'); if profileSrcRec.FindFirst() then begin profileNewRec.Init(); profileNewRec.Validate("Profile ID", 'IFTAM2'); profileNewRec.Validate(Description, 'Profile for IFTAM Integration'); profileNewRec.Validate("Role Center ID", profileSrcRec."Role Center ID"); profileNewRec."Disable Personalization" := profileSrcRec."Disable Personalization"; Clear(profileNewRec."App ID"); profileNewRec."App Name" := ''; // profileNewRec."Extension Name" := ''; // profileNewRec."Published As" := profileNewRec."Published As"::"Tenant Customization"; profileNewRec.Insert(); end; end;
However, when I tested it, the app unfortunately crashed during execution — no clear AL error message, just a session crash.
And I can't find fields "Extension Name" and "Published As"?
"Extension Name" and "Published As"
✅ Solution Found
I discovered that the issue was caused by trying to create a new profile based on an existing system profile (“RAPIDSTART SERVICES”), which isn’t allowed directly because it belongs to another app (the Base App).
To fix this, I created a procedure that copies the existing profile into a new tenant-owned one using the "Conf./Personalization Mgt." codeunit:
Conf./Personalization Mgt."
procedure CreateProfile() 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 Message('Profile %1 created successfully.', profileNewRec."Profile ID"); end; end;
This uses the built-in CopyProfileWithUserInput method to safely duplicate an existing profile while ensuring the new one is registered as a tenant customization (with an empty App ID).
CopyProfileWithUserInput
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 1,946 Super User 2026 Season 1
YUN ZHU 1,177 Super User 2026 Season 1
Khushbu Rajvi. 555 Super User 2026 Season 1