Loading
The Trailblazer Community is now read-only Read More
Media Cloud
Configure Automatic Release of Inventory Slots

Configure Automatic Release of Inventory Slots

Set a configuration to automatically release reserved inventory slots, which are in On Hold status, after a defined period. This process makes the slots available for other opportunities. After the slots are released, your users get a notification.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Performance, and Unlimited editions with Media Cloud- Growth or Media Cloud- Advanced

Here's a format of the Apex job that you can use to configure automatic release of reserved slots to other opportunities:

Datetime now = System.now();
// Format in ISO 8601 UTC (GMT) format with milliseconds and 'Z' suffix
String iso8601String = now.formatGMT('yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'');
System.debug('iso8601String: ' + iso8601String);

// Create the action
Invocable.Action action = Invocable.Action.createStandardAction('releaseInventorySlots');

// action.setInvocationParameter('adSpaceCapacityAllocationIds', allocationIds);
action.setInvocationParameter('releaseBeforeDateTime', iso8601String);
action.setInvocationParameter('releaseAfterDateTime', '2025-10-03T23:59:59.000Z');
action.setInvocationParameter('currentAllocationStatus', 'On Hold');
action.setInvocationParameter('updatedAllocationStatus', 'Released');
action.setInvocationParameter('shouldSendNotification', true);

// Invoke the action
List<Invocable.Action.Result> results = action.invoke();

// Optionally, handle results or errors
for (Invocable.Action.Result result : results) {
     if (!result.isSuccess()) {
          System.debug('Failed to release inventory slot: ' + result.getErrors());
            }
}
 
Loading
Salesforce Help | Article