Hello Fellow Forum Members,
I am trying to implement a CRT (Commerce Runtime) extension that cancels a outbound transfer is the quantity of that transfer is greater than 50 units. I was wondering if someone could help me out here. I am newer to this platform and C# in general.
Here is my code so far:
public async Task OnExecuting(Microsoft.Dynamics.Commerce.Runtime.Messages.Request request) { if (request is CommitInventoryInboundOutboundDocumentOperationRequest commitInventoryInboundOutboundDocumentOperationRequest) { String documentId = commitInventoryInboundOutboundDocumentOperationRequest.DocumentId; var inventDocumentRequest = new GetInventoryInboundOutboundDocumentRequest(documentId, false); var inventDocumentResponse = (await request.RequestContext.Runtime.ExecuteAsync<EntityDataServiceResponse<InventoryInboundOutboundDocument>>(inventDocumentRequest, request.RequestContext).ConfigureAwait(false)); }}
Hastebin:
Thank you all so much have a great one!