
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.