Create Extension
The Create Extension function generates the AL code extension that implements your security and compliance rules. This is the final and most critical step of the Build phase.
Why Extension Generation is Required
Business Central runs in the cloud and doesn't allow runtime code modification. ACS works by:
- Reading your security feature definitions
- Generating AL code that implements the rules
- Compiling this code into an extension
- Installing the extension in your environment
This means your security rules only take effect after the extension is created and installed.
Accessing Create Extension
- Open Advanced Cloud Security from the Tell Me search
- Click Create Extension in the Build phase column
- The extension generation process begins
What Gets Generated
The extension generation creates AL code for:
Page Extensions
For every page with controlled fields or actions:
pageextension 70319XXX "ACS Customer Card" extends "Customer Card"
{
layout
{
modify("Credit Limit (LCY)")
{
Visible = ACSVisible_CreditLimit;
Editable = ACSEditable_CreditLimit;
}
}
}
Security Evaluation Code
Code that evaluates user security at runtime:
- Checks security feature assignments
- Resolves user filter values
- Calculates effective visibility/editability
- Applies data filters
Compliance Integration
If using compliance:
- Field change tracking triggers
- Approval workflow integration
- Compliance status indicators
The Generation Process
Step 1: Validation
ACS validates your configuration:
- Security features are properly defined
- Field references are valid
- No circular dependencies exist
- Compliance tables are correctly configured
Step 2: Code Generation
ACS generates:
- Page extension objects
- Table extension objects (if needed)
- Codeunits for security evaluation
- Enum extensions (if needed)
Step 3: Compilation
The generated code is compiled:
- Syntax validation
- Dependency resolution
- Binary output creation
Step 4: Packaging
The compiled code is packaged as a .app file:
- Extension manifest
- Compiled objects
- Resources
Step 5: Installation
The extension is installed in your environment:
- Previous version is uninstalled
- New version is installed
- Schema updates are applied
Generation Progress
During generation, you'll see:
| Stage | Description |
|---|---|
| Analyzing | Reading security configurations |
| Generating | Creating AL code files |
| Compiling | Building the extension |
| Packaging | Creating the app file |
| Installing | Deploying to Business Central |
After Generation
After successful generation:
- Refresh your browser (F5 or Ctrl+R)
- Test a few pages to verify security is working
- Check that compliance indicators appear (if applicable)
- Verify in Extension Management that the extension is installed
When to Regenerate
You must regenerate the extension when you:
| Change | Regenerate Required |
|---|---|
| Create a new security feature | Yes |
| Add fields to a feature | Yes |
| Remove fields from a feature | Yes |
| Modify field control settings | Yes |
| Add/remove action controls | Yes |
| Add/remove data access rules | Yes |
| Delete a security feature | Yes |
| Add compliance tables | Yes |
| Change conflict field handling | Yes |
| Assign features to users | No |
| Configure user filter values | No |
| Configure compliance rules | No |
| Add/remove approvers | No |
Regeneration Best Practices
Always Test First
Before regenerating in production:
- Test changes in a sandbox environment
- Verify all affected pages work correctly
- Check for compilation errors
- Validate security behavior
Plan Regeneration Windows
Regeneration causes a brief interruption:
- Schedule during low-usage periods
- Notify users of the change
- Have a rollback plan ready
Keep Previous Versions
ACS maintains version history:
- Previous extension versions are retained
- You can rollback if needed
- Version numbers increment automatically
Troubleshooting Generation
Compilation Errors
If compilation fails:
| Error Type | Possible Cause | Solution |
|---|---|---|
| Field not found | Field was removed from BC | Remove field from security feature |
| Page not found | Page was removed/renamed | Update page reference |
| Syntax error | Invalid filter expression | Check data access filters |
| Dependency error | Missing base extension | Install dependencies first |
Installation Errors
If installation fails:
| Error Type | Possible Cause | Solution |
|---|---|---|
| Schema conflict | Data migration issue | Contact support |
| Permission error | Insufficient permissions | Verify admin access |
| Version conflict | Concurrent modification | Retry installation |
Runtime Errors
If the extension installs but doesn't work:
- Check Extension Management for errors
- Review Application Insights logs
- Verify security features are assigned to the user
- Test with a simple security feature first
Extension Details
Extension Properties
The generated extension has:
| Property | Value |
|---|---|
| Name | Configurable in ACS Setup ("Name for Wrapper Extension") |
| ID | Automatically assigned GUID |
| Target | Cloud |
| Runtime | Matches your BC version |
Viewing Generated Code
You cannot view the generated AL code directly, but you can:
- Review what security features are defined
- Check field and action controls
- Examine conflict field resolutions
Rollback Procedure
If you need to rollback:
- Go to Extension Management
- Find the generated ACS wrapper extension (by the name configured in Setup)
- Uninstall the current version
- Regenerate with corrected security features
Or regenerate with corrected security features.
Version History
Each regeneration:
- Increments the version number
- Is logged in the system
- Can be audited for compliance purposes
Performance Considerations
Extension generation:
- Takes 1-5 minutes typically
- Longer for many security features
- Does not affect users until installed
- Installation has minimal downtime