Draft Pending Usage Input Related to ALIs
draftPendingUsageInputRelatedToALIs API is used to draft rate (forecast) all usage inputs related to a specific Asset Line Item IDs. It processes the usage inputs in batch mode, allowing you to forecast the billable amount for those usage inputs before actually rating them for billing.
| API | Signature |
|---|---|
| draftPendingUsageInputRelatedToALIs | static void
draftPendingUsageInputRelatedToALIs( set assetLineItemIds) |
The API accepts a set of Asset Line Item IDs. It can process up to 1000 Asset Line Item IDs at once. The API runs asynchronously in the background. You'll get an email notification when processing is complete.
The (Draft) Rated Amount on Usage Input, (Draft) Rated Quantity and (Draft) Fee Amount on Usage Schedule are updated. The actual Rated Amount and billing schedule are not affected. The Usage Inputs remain in Loaded status after draft processing. If there's an error, the status changes to Error and the Message field is populated. This API is for draft rating (forecasting) purposes. Once you're satisfied with the draft values, you can process the usage inputs for actual billing.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| assetLineItemIds | Set | Yes | Set of Asset Line Item IDs. |
Response
- For synchronous processing, check the Usage Input records for updated draft fields.
- For asynchronous processing, you'll get an email notification with the results.
Code Sample - Request
// To process all usage inputs related to specific Asset Line Items asynchronously
Set<ID> assetLineItemIds = new Set<ID>{'a0eDc000002Vq9A'};
Apttus_Billing.UsageService.draftPendingUsageInputRelatedToALIs(assetLineItemIds);
// To process all usage inputs in the system
Apttus_Billing.UsageService.draftPendingUsageInput();
// To process specific usage inputs synchronously
Set<ID> usageInputIDs = new Set<ID>{'a5aDc0000001tlN','a5aDc0000001tlI'};
Apttus_Billing.UsageService.draftPendingUsageInput(usageInputIDs, true);