Skip to main content

Microsoft Dynamics NAV 2016 - Implement the Camera in C/AL.

Hi All,

With Microsoft Dynamics NAV 2016 Camera can be integrated with Dynamics NAV Client.

This article steps how we can add access to camera to a specific page from the development environment. Adding a camera option to the Item card, for example, lets you take a picture of a specific item and store it with the item.

Thanks To +nishant srivastava  & +Riska Tirtasari  for the post, who suggested to have  this article.

Remember - Camera Integration will work only on Phone / Tablet Client.

1. In the development environment, on the Tools menu, choose Object Designer to open the Object Designer window.

2. In Object Designer, choose Pages, select the Item Card (page 30) and choose the Design button.

3. Add Picture in the general tab as shown below.

4. From the Page Designer window, on the View menu, choose C/AL Globals.

Create the following two variables:

Variable name
Microsoft.Dynamics.Nav.Client.Capabilities.CameraProvider.'Microsoft.Dynamics.Nav.ClientExtensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

5. Make sure to set the properties RunOnClient and WithEvents to Yes, for the Camera Dotnet Variables as shown below.

6. Let's Now add an action for Accessing Camera. Add a action with following properties -

Name - TakePicture.
Enabled - CameraAvailable
Image - Camera.
Promoted - Yes.
Promoted Category - Process.
PromotedIsBig - Yes.

Add Following Code for the New Action Created.

7. As we enabled WithEvents for the New Camera DotNet Variable. A New Trigger will be available as below - 
Camera::PictureAvailable(PictureName : Text;PictureFilePath : Text)

Add following code for uploading Image In the Database. 
Rec.Picture := TempBlob.Blob;
MESSAGE('Image Updated For Item %1 - %2',Rec."No.",Rec.Description);

8. Now at last we only want to have the new action enabled only if camera is available & user is using the correct Client. 

In OnOpen Page of Item card add following Code.
IF Camera.IsAvailable THEN
  Camera := Camera.Create;
  CameraAvailable := TRUE;

For the Demo I used Microsoft Dynamics NAV 2016 W1.
You can download the Pre & post objects in Text Format from Dynamics User Group

Demo of Camera Integration -

Your Views on the article are much awaited. Stay connected, yet more to come.

Saurav Dhyani


Popular posts from this blog

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing - 

Dynamics 365 Business Central 2021 release wave 2 (BC19) Released.

Hi Readers, As we all were expecting Microsoft have Released Business Central 2021 Release Wave 2 Today a.k.a BC19. In this article we will see what all is announced with the General Availability.  Starting Today Customers & Partners can start using Business Central 19. #msdyn365bc #bc19

MSDYN365BC - Data Upgrade To Microsoft Dynamics 365 Business Central on premises.

Hi Readers, We have already talked about the number of steps for upgrading to Business Central on Premises from different NAV versions. After that article, I received multiple requests for an article which list down steps for Data Migration. In this article, we will discuss steps of data migration to MSDYN365BC (on-Prem) from NAV 2017. For this article, I am considering a Cronus Demo Database without any customization. For an actual upgrade project, we will have to complete object merge using compare and Merge process. After the Merge Process, the next step is data migration. Let's discuss those steps. Direct Upgrade to Microsoft Dynamics 365 Business Central (on-Prem) is from following versions - 1. NAV 2015. 2. NAV 2016. 3. NAV 2017. 4. NAV 2018.