Code snippet to convert string to memory stream in Dynamics 365 finance and operations
Views (112)
Most common scenario to convert string to memory stream in D365FO. Please find the below code for the same.
public static System.IO.Stream JP_generateStreamFromString(str _text)
{
System.Byte[] byteArray;
System.IO.MemoryStream memoryStream;
byteArray = System.Text.Encoding::UTF8.GetBytes(_text);
memoryStream = new System.IO.MemoryStream(byteArray);
return memoryStream;
}
Hope this helps!, I will come up with another interesting blog post!

Like
Report
*This post is locked for comments