Newer Version Available

This content describes an older version of this product. View Latest

Triggering CSV Export

This Apex call expects the mandatory values of the business year, the actual name of the RTR report config record, and the sales org that must be exported.

You can trigger the CSV export by making an Apex call. A maximum of 2000 exports can be triggered in a day.

Sample Apex Request
1<namespace>.OffPlatformCallout request = new 
2<namespace>.OffPlatformCallout('SCHEDULE_RTR_EXPORT','0001');
3Map<String, Object> data = new Map<String, Object>();
4data.put('metaname','ReportData0001');
5data.put('salesorg', '0001');
6data.put('businessyear',2022);
7
8String requestBodyContent = JSON.serialize(data, true);
9Map<String, String> params = new Map<String, String>();
10
11<namespace>.OffPlatformCalloutResponse response = request.execute(<namespace>.TransactionHandler.getTransactionIdentifier(), params, requestBodyContent);
12System.debug(response);
Sample Response

The response contains a unique identifier for this export in JSON format. This GUID is needed in the subsequent calls.

1{
2  "csvGuid": "94f49a3f-37bc-4794-8051-123456789"
3}