Start a conversation

Closed Replaced Subscription Blocking MACD Creation

Problem

When attempting to create a MACD (Moves, Adds, Changes, Deletes) change order from an existing solution, the MACD creation fails with an error indicating that one or more subscriptions are in a "Closed Replaced" status.

Common error messages include:
- "Cannot create change order: subscription is in Closed Replaced status"
- "MACD creation blocked: subscription has been replaced"
- "Change order cannot be created for replaced subscriptions"

This prevents users from:
- Creating change orders for active services
- Modifying or updating subscriptions that appear to be active
- Performing standard MACD operations on what should be modifiable subscriptions

Root Cause

One or more subscription records associated with the solution have their Status field set to "Closed Replaced". This status indicates that the subscription has been replaced by a newer subscription (typically through a previous MACD or renewal process).

CloudSense prevents MACD creation on "Closed Replaced" subscriptions because:
- Replaced subscriptions are considered closed and should not be modified
- Changes should be made to the replacement subscription, not the original
- Allowing modifications to replaced subscriptions would create data inconsistencies

However, this error can occur incorrectly when:
- The subscription status was set to "Closed Replaced" in error
- A previous MACD failed partway through, leaving the status incorrect
- Data was manually updated or imported with incorrect status values
- The subscription is actually active but the status field was not properly maintained

Resolution

Step 1: Identify the Affected Subscription

  1. Review the error message to identify which subscription is blocking MACD creation
  2. Navigate to the subscription record in Salesforce
  3. Verify the Status field shows "Closed Replaced"

Step 2: Determine if the Status is Correct

Review the subscription to determine if it should actually be in "Closed Replaced" status:

Indicators the status is CORRECT:
- A newer subscription exists that replaced this one
- The subscription end date is in the past
- Related orders show a successful replacement or renewal process
- Billing records confirm the subscription was replaced

Indicators the status is INCORRECT:
- The subscription should be active (end date is in the future)
- No replacement subscription exists
- Billing is still active for this subscription
- The subscription is being used in active services

Step 3: Correct the Subscription Status

If the "Closed Replaced" status is incorrect and the subscription should be active:

  1. Navigate to the subscription record
  2. Click Edit
  3. Change the Status field to the appropriate value:
  4. Active: For subscriptions that are currently in service
  5. Pending: For subscriptions that have been ordered but not yet activated
  6. Suspended: For subscriptions that are temporarily inactive

  7. Click Save

  8. Verify the save completes without errors

Important Considerations:
- Replacement Subscription: If a replacement subscription was created but should not have been, you may need to cancel or delete the replacement subscription
- Billing Impact: Changing the status may impact billing; coordinate with your billing team before making changes
- Audit Trail: Document why the status was changed and who authorized the change

After correcting the status, verify related records are consistent:

  1. Related Services: Verify the services associated with the subscription have the correct status
    sql SELECT Id, Name, csord__Status__c FROM csord__Service__c WHERE csord__Subscription__c = '[subscription_id]'

  2. Related Orders: Verify no pending or failed orders are impacting the subscription
    sql SELECT Id, Name, csord__Status__c FROM csord__Order__c WHERE Id IN (SELECT csord__Order__c FROM csord__Subscription__c WHERE Id = '[subscription_id]')

  3. Billing Records: Verify billing records reflect the correct subscription status

Step 5: Create the MACD

  1. Navigate to the solution record
  2. Click Create Change Order or Create MACD
  3. Verify the MACD basket is created successfully
  4. Proceed with configuring and submitting the change order

Step 6: Identify and Fix the Root Cause

To prevent recurrence, identify how the incorrect status was set:

If caused by a failed MACD:
- Review the failed MACD order and its error logs
- Determine why the MACD failed and fix the underlying issue
- Ensure future MACDs complete successfully or roll back status changes on failure

If caused by manual data entry:
- Train users on the correct subscription lifecycle and status values
- Restrict edit access to the Status field to prevent accidental changes

If caused by custom code:
- Review custom Apex triggers, classes, or integrations that update subscription status
- Ensure status transitions follow the correct lifecycle (Active -> Closed Replaced only when a replacement exists)
- Add validation logic to prevent invalid status transitions

If caused by data import:
- Review the data import process and source data
- Ensure status values are validated before import
- Test imports in sandbox before running in production

Prevention

For Salesforce Users

  • Status Awareness: Understand the subscription lifecycle and what each status means
  • MACD Planning: Before creating a MACD, verify all subscriptions are in the correct status
  • Error Review: When MACD creation fails, review the error message carefully to identify the blocking subscription

For Salesforce Administrators

  • Field-Level Security: Restrict edit access to the Status field to prevent accidental changes
  • Validation Rules: Implement validation rules to prevent invalid status transitions (e.g., Active -> Closed Replaced without a replacement subscription)
  • Field History Tracking: Enable field history tracking on the Status field to audit changes
  • Regular Audits: Periodically query for subscriptions in "Closed Replaced" status and verify they have valid replacement subscriptions

For Implementation Teams

  • Status Lifecycle Logic: Ensure custom code and integrations follow the correct subscription status lifecycle
  • Rollback Logic: Implement rollback logic in MACD processes to revert status changes if the MACD fails
  • Testing: Test MACD workflows with various subscription statuses to understand behavior
  • Monitoring: Monitor for subscriptions in "Closed Replaced" status without valid replacement subscriptions
  • Affected Objects: csord__Subscription__c, csord__Service__c, csord__Order__c, cscfga__Basket__c
  • Related Fields: csord__Status__c, csord__Replacement_Subscription__c, csord__End_Date__c
  • Related Processes: MACD (change orders), subscription lifecycle management, renewal processes
  • Subscription Statuses: Active, Pending, Suspended, Closed, Closed Replaced, Cancelled
  • Lifecycle: Active -> Closed Replaced (only when replacement subscription exists)
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments