Handle Conflict Fields
When implementing field-level security, you may encounter fields that already have visibility or editability expressions defined in Business Central or other extensions. These are called Conflict Fields. This guide explains how to identify and resolve them.
What is a Conflict Field?
A conflict field is a page control (field or action) that already has:
- A
Visibleproperty expression - An
Editableproperty expression - An
Enabledproperty expression
These existing expressions conflict with ACS's ability to control the field because AL allows only one expression per property.
Why Conflicts Occur
Business Central and extensions often include conditional logic like:
Visible = SalesSetup."Credit Limit Warning"
Editable = NOT Rec.Posted
Enabled = HasPermission
When ACS tries to add its own visibility control, it cannot simply override these expressions—it must incorporate them.
Accessing Conflict Fields
- Open Advanced Cloud Security from the Tell Me search
- Click Handle Conflict Fields in the Build phase column
- The Conflict Fields page opens
Understanding the Conflict Fields Page
The page shows all fields with existing expressions:
| Column | Description |
|---|---|
| Page No. | The page where the conflict exists |
| Kind | Control type (Field, Action, etc.) |
| Name | The control name |
| Used On Features | How many security features use this field |
| Enabled | Existing Enabled expression |
| Visible | Existing Visible expression |
| Editable | Existing Editable expression |
Conflict Resolution Strategies
Strategy 1: Leave As-Is
If a field has an existing expression but no security features need to control it:
- Leave the conflict unresolved
- The field will behave according to its original expression
- ACS will not modify this field
Strategy 2: ACS Overrides
If you want ACS to completely control the field:
- Select the conflict field
- Choose to override the original expression
- ACS security will take full control
- Original business logic is replaced
Warning: This may disable intended business functionality.
Strategy 3: Combined Logic (Recommended)
ACS can combine the original expression with security rules:
- Select the conflict field
- Choose combined mode
- ACS generates:
OriginalExpression AND ACSSecurityResult - Both conditions must be true for the field to show/be editable
Example: Combined Logic
Original expression:
Visible = SalesSetup."Show Credit Info"
With ACS security:
Visible = SalesSetup."Show Credit Info" AND ACSVisible_CreditInfo
Result: Field shows only if BOTH:
- Setup says to show it
- User has ACS permission
Linking Conflicts to Features
You can associate conflict fields with specific security features:
- Select the conflict field
- Click Link to Feature
- Select the security feature
- The conflict resolution applies to that feature
Common Conflict Scenarios
Scenario 1: Posted Document Fields
Many fields are read-only when a document is posted:
Editable = NOT Rec.Posted
Resolution: Use combined logic so the field is:
- Not editable when posted (business rule)
- Not editable when user lacks permission (security rule)
Scenario 2: Setup-Controlled Visibility
Some fields appear based on setup:
Visible = GeneralLedgerSetup."Enable Dimensions"
Resolution: Use combined logic to respect both:
- Setup configuration
- User security permissions
Scenario 3: Permission-Based Visibility
Some fields check user permissions:
Enabled = HasPermission
Resolution: Use combined logic to layer ACS security on top of existing permission checks.
Detecting New Conflicts
Conflicts can appear when:
- You upgrade Business Central
- You install new extensions
- Extensions are updated
Checking for New Conflicts
- Periodically open Handle Conflict Fields
- Look for unresolved conflicts
- Determine if they affect your security features
- Resolve as appropriate
Conflict Resolution Workflow
Step 1: Review All Conflicts
Open the Conflict Fields page and review each entry:
- Understand what the original expression does
- Determine if it's business-critical logic
- Identify if any security features need this field
Step 2: Prioritize
Focus first on:
- Fields used by security features
- Fields with complex expressions
- Critical business pages
Step 3: Resolve
For each relevant conflict:
- Choose a resolution strategy
- Link to appropriate security features
- Document your decision
Step 4: Test
After resolving conflicts:
- Regenerate the extension
- Test affected pages
- Verify both security and business logic work
Best Practices
Document Your Decisions
Keep records of:
- Why you chose each resolution strategy
- What the original expression did
- Potential impacts of the resolution
Prefer Combined Logic
Combined logic preserves business functionality while adding security. Only override when absolutely necessary.
Review After Updates
After Business Central or extension updates:
- Check for new conflict fields
- Verify existing resolutions still work
- Update as needed
Test Thoroughly
Conflict resolution can have unexpected impacts:
- Test with users who have the feature assigned
- Test with users who don't have the feature assigned
- Test all related business processes
Troubleshooting
Field Behavior Unexpected
If a field doesn't behave as expected after conflict resolution:
- Check the resolution strategy used
- Verify the security feature assignment
- Review the original expression
- Test with combined logic
Extension Won't Compile
If the generated extension has errors:
- Check for invalid conflict resolutions
- Verify expression compatibility
- Contact support if issues persist
Business Logic Broken
If business functionality stops working:
- Change from "Override" to "Combined"
- Regenerate the extension
- Verify business logic is restored