Skip to main content

Notifications

Announcements

No record found.

Call custom service with JSON body in D365FO

Call Custom Service with JSON Body in D365FO

Call Custom Service with JSON Body in D365FO

        
FileUploadTemporaryStorageResult fileUpload = File::GetFileFromUser() as FileUploadTemporaryStorageResult;
System.IO.Stream stream = fileUpload.openResult();
str responceJson;

using (var reader = new System.IO.StreamReader(stream))
{
    responceJson = reader.ReadToEnd();

    TESTPOReceiptRequestContract contract = FormJsonSerializer::deserializeObject(
        classnum(TESTPOReceiptRequestContract), responceJson);

    new TESTPOReceiptService().processRecord(contract);
}
        
    

This was originally posted here.

Comments

*This post is locked for comments