Friday, July 5, 2019

File Handling in Business Central SaaS

Hello readers,
Today I'm going to discuss on file handling in business central SaaS. 
Already other bloggers have been written for onpremis.

As we know that business central discontinued the File variable to handle the files. 

But we can handle this using FileStream. 

Below is the list that i will cover in my blog. 

File Handling in Business Central – SaaS

  • Import Picture with/without Camera
  • Export Picture
  • Export to Excel
  • Save as Report in PDF/Excel...
  • Send Email with Report Attachment
  • Export Data thru XMLPort
  • Read/Append Text file



Import Picture with/without Camera:
To upload the picture in business central (SaaS), we need to extend “Camera Interaction” page in our project.
Another option is also available to upload files using stream.
For demo purpose I’m going to create a page extension of customer card.
Create a page extension of customer card in your project.

Add actions, Take Picture, Import picture as shown in below screenshot.




Add another action Import Picture as shown below Code

 action("Import Picture")
        {
          ApplicationArea = All;
          ToolTip = 'Import a picture file.';
          Caption = 'Import';
          Image = Import;

          trigger OnAction()var FileName: Text;
          PictureStream: InStream;
          FileFilter: Text;
          DialogCaption: Label 'Select a picture to upload';
          begin
            TestField("No.");
            if Image.HASVALUE then if not CONFIRM(OverrideImageQst)then exit;
            if UploadIntoStream(DialogCaption, '', FileFilter, FileName, PictureStream)then begin
              Image.ImportStream(PictureStream, FileName);
              Modify(TRUE);
            end;
          end;
        }

//======================\\
For Exporting see the below screen shot. 





Publish the extension, after publishing the extension login the business central , open the customer card as shown in below screen shot. 





Click on Take Picture to upload the customer picture.

Note:
Currently TakePicture only supported in inbuilt camera. Like Mobile, Tablet client.
You can also use in laptop or desktop but you need to install the Business Central App from Store.
Currently Camera is not supported in browsers.

To test another action click on Import Picture as shown in below screen shot.



For Exporting the picture just click on Export Picture, picture will automatically download in your download location. 


For today that's it, Thank you for reading.
Feel free to commenting your opinion.

Will cover the remaining in our next blog.

11 comments:

  1. Wonderful, Can you please share the Extention for this.

    ReplyDelete
  2. Thank you Mr. Sameer, please share your email Id.

    ReplyDelete
  3. Hi can it be uploaded as document attachment instead of picture?
    i need this feature for Purchase Order.
    Thank

    ReplyDelete
  4. Hi Xtan, Attachments feature is already available in the Business Central in Purchase Order card page under Attachments factbox area.

    ReplyDelete
  5. I appreciate you for giving such an informative portal on business central consultant

    ReplyDelete
  6. SMB ERP Solution is a Microsoft Silver Partner. We provide Supply Chain Management Solutions, Microsoft NAV, Microsoft Dynamics NAV, Microsoft Dynamics Business Central. Contact us info@smb-erpsolutions.com for more details. Check out our website for more detials- Dynamics NAV Upgrade

    ReplyDelete
  7. SMB ERP Solutions to provide done with guidance and implementing best industry practices in Dynamics NAV, Business Central, Accounting Software & Enterprise Software in US and canada. check out our website for more details; Microsoft NAV in USA

    ReplyDelete
  8. Hi Binesh,
    I have to export multiple xml files in a single zip file. For example customer list i have created action "Get Invoices in zip" when user click this zip file should be downloaded with all invoices.
    can we do this

    ReplyDelete
  9. Thank you for sharing this informative information with us. Its very helpful. Saas Based ERP for Import Export

    ReplyDelete
  10. Informative and helpful Article. Really good work. Appreciate it. You might be looking for ERP software provider in Bangalore

    ReplyDelete
  11. Very informational blog. Thanks to the author for providing it. OKRs are also useful for a SaaS organization.

    ReplyDelete

Popular Posts