c2g.SalesCreditNoteEInvoicingServiceglobal with sharing class SalesCreditNoteEInvoicingService API methods for sending a sales credit note via the configured electronic invoicing provider. Sending a sales credit note will update the record to set fields used for tracking the progress and make a callout to the configured electronic invoicing provider. Because of platform restrictions around making callouts, there are multiple API methods covering different parts of this process to allow you to split the work across multiple execution contexts as needed. Methods
sendAsyncglobal static c2g.SalesCreditNoteEInvoicingService.SendAsyncResponse sendAsync(Set<Id> salesCreditNoteIds) Performs all operations needed to send electronic invoices from sales credit note. The sales credit note will be updated synchronously to mark them as sending, and a queueable will be started that makes the callout to the electronic invoicing provider asynchronously. Because this method starts a queueable, take care using it from code that may be called from a batch or queueable process where there are tight limits on the number of queueables that can be started. Input Parameters
Return ValueAn object containing the ID of the AsyncApexJob started by this method. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code validateSalesCreditNotesglobal static c2g.SalesCreditNoteEInvoicingService.ValidationResponse validateSalesCreditNotes(Set<Id> salesCreditNoteIds) Returns information about the validity of the sales credit notes for sending as electronic invoices. For example if the sales credit notes status is not Complete or the delivery status is already Delivered. Input Parameters
Return ValueAn object containing information about the validity of the sales credit notes. c2g.SalesCreditNoteEInvoicingService.EInvoicingResponseglobal abstract with sharing class EInvoicingResponse Abstract base class that all other electronic invoicing response classes extend. Customers are not expected to extend this themselves, but you can refer to other responses using this type to build common error-handling code. Provides a map of errors by record id. Properties
c2g.SalesCreditNoteEInvoicingService.ValidationResponseglobal with sharing class ValidationResponse extends EInvoicingResponse Returns information on the validity of sales credit notes. This class extends c2g.SalesCreditNoteEInvoicingService.EInvoicingResponse Properties
MethodsValidationResponseglobal ValidationResponse(Map<Id, List<String>> errorMap) ValidationResponseglobal ValidationResponse() c2g.SalesCreditNoteEInvoicingService.SendAsyncResponseglobal with sharing class SendAsyncResponse extends EInvoicingResponse Response to a request to the `sendAsync` method. This contains information about what has happened when executing `sendAsync`. This class extends c2g.SalesCreditNoteEInvoicingService.EInvoicingResponse Properties
Methods
SendAsyncResponseglobal SendAsyncResponse(Id asyncApexJobId) Constructs a SendAsyncResponse. Input Parameters
SendAsyncResponseglobal SendAsyncResponse(Map<Id, List<String>> errorsById) Constructs a SendAsyncResponse. Input Parameters
|