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());
}
}
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.