Create Credit Memo Documents
createCreditMemoDocuments API is used to generate credit memo documents.
|
API |
Signature |
|---|---|
|
createCreditMemoDocuments |
|
It generates credit memo documents for the given list of credit memo IDs.
You can generate credit memo documents in the following formats:
- DOCX
- DOC
- RTF
It accepts a list of Credit Memo IDs and a valid credit memo template name as input. If you do not specify a valid template name or pass null as a value, Billing Management system uses the default template provided at the Account or the Account Location.
If you call this API from a batch or a scheduled job, it can process only one CreditMemo ID. Otherwise, if you call this API from a non-batch or a non-scheduled job, it can process up to 10 CreditMemos.
|
Request | |||
|---|---|---|---|
|
Field |
Type |
Required? |
Description |
|
creditMemoIds |
List <Id> |
Yes |
IDs of credit memo |
|
creditMemoTemplateName |
String |
No |
Name of the credit memo template |
Account testAccount = new Account(Name = 'SS Test Account');
insert testAccount;
Apttus_Billing__CreditMemo__c testCreditMemo = new Apttus_Billing__CreditMemo__c(Apttus_Billing__BillToAccountId__c = testAccount.Id,
Apttus_Billing__CreditAmount__c = 50.0,
Apttus_Billing__Status__c = 'Draft');
insert testCreditMemo;
List<Id> cmIdList = new List<Id> {testCreditMemo.Id};
//create Credit Memo Documents
Apttus_Billing.CreditMemoService.createCreditMemoDocuments(cmIdList, 'Default-CMT');
