How attach files without tempblob record?
I have an extension to attach files into a record, and of course, withe the new version I get the error, and the solutons proposed:
Error: Argument 1: cannot convert from 'Record TempBlob' to 'var Codeunit "Temp Blob"'
Solution: Use codeunit 4100 "Temp Blob" API instead of the record API.
Im' trying to find the solution, but I don't get any. I've found this:
https://community.dynamics.com/business/b/dynamics365businesscloudfronts/posts/how-to-attach-documents-to-any-record-of-any-table-in-business-central
But they use the tempblob record, so I can't use that.
I've openned the baseApp to see how it's done inthe standard, but I cannot use that way either:
Which is the corerct way to create a extension for cloud in the latest release to attach files?
Thnak you very much!
Hi @aetxebarria,
I've also an extension storing files directly in blob field and of course it's broken in BC 15 release. I solved it this way:
[..]
fileMgmt.BLOBImportWithFilter(TempBlobCodeunit, SelectFileMsg, '', FileFilterTxt, 'txt');
tempBlobCodeunit.CreateInStream(streamIn);
"MyBlobField".CreateOutStream(streamOut);
CopyStream(streamOut, streamIn)
[..]
Maybe that helps you...
Hi @sirhc101, Thank you, it worked!!!!!