Media Datatype-NAV2017

In this blog will try to explain how Media data type works in NAV2017 for uploading media,image.

Media data type store media in system tables of the database and then reference the media from application records. Media datatype provided better performance than traditional BLOB datatype. With BLOB datatype ,media is rendered every time in the client ,Media datatype provides unique Media ID to provide the data to client.

Table fields support data types for adding media to records. You can import media directly to a record . This media will get store in the system table Tenant Media with the unique identifier (ID). 

The media data type is associated with single media.

HOW TO USE MEDIA DATATYPE

Following example illustrate how to use Media data type in development.

Table

Field Id Field Name Data type
1 PictureNo Integer
2 MyPicture Media

Create list page and card page with above fields

Create one Action button on Page for importing the image.

Define following variable

filename   Text   250

MediaID   GUID
filename:=’E:\Photo.jpg’;
IF filename<>” THEN BEGIN
MediaID :=Rec.MyPicture.IMPORTFILE(filename,’Media Image’+FORMAT(Rec.PictureNo));
MODIFY;
END;

In tenant Media table following GUID will get inserted

tenant

Now Open the page in Web client and see the result

 

Following Media types are supported.

  • BMP
  • EMF
  • EXIF
  • GIF
  • JPEG
  • PNG
  • TIFF
  • WMF

You can use this method for applications that are developed for the Microsoft Dynamics NAV Web client and Microsoft Dynamics NAV Universal App:

  • Display media with records in list type pages, when the page is viewed in the Brick layout.
  • Display media on a card type page for a record.
  • Display media in a report.

 

Keep testing and let me know your feedback

Cheers….

Page Extension -Tenerife Visual Studio Code

In previous post Table Extension we saw how to extend table using Tenerife (New NAV development tool) .In this blog post we will see how to extend Pages using visual studio code.

The page objects extends a dynamics NAV page object .This will used for add or overrides the functionality.The structure of page is divided into three parts

  1. First part contains metadata for the entire page
  2. Second part describes visual parts on page
  3. Final Part describes action published on page

In visual studio typing tpageext will create the basic layout for page object when using AL extension in Visual Studio code.

 How to Write Code 

For example if you would like to add the custom field and Action button then you can wrtie code as follows.

pageextension

pageextension 70000030 VendorCardExtension extends "Vendor Card"
{
 layout
 {
 addlast(General)
 {
 field("Credit Days"; CreditDays)
 {
 CaptionML = ENU='CreditDays';

 trigger OnValidate();
 begin
 if CreditDays < 0 then
 Error('Credit Days Can not be blank');
 end;
 }
 }

 }

 actions
 {
 addlast(Creation)
 {
 group(MyActionGroup)
 {
 Action(MyAction1)
 {
 trigger OnAction();
 begin
 Message('Action Button is operating');
 end;
 }
 
 }
 }
 }

}

Keep Learning and Stay tuned for more updates…

Cheers…

Create Table Extension with Tenerife-Visual Studio Code

At the moment Microsoft development tool is still evolving and getting updated day by day.

In this blog post we will see how how to create Table extension object.

The table extension allows you to add more fields or change properties on a table. Along with defining other fields,the table extension is where you can write trigger code for additional fields.

In visual studio code by typing ttableext will create basic layout for table extension object when using AL extension in Visual Studio code.

Following properties can be changed for table

  1. Width
  2. OptioncaptionML
  3. Description
  4. ClosingDates

How to Write Code 

For example now if you would like to add one field in table and write some validation on that field then you can write as follows. In this I am adding field in Table 23 Vendor as Credit Days with datatype Integer.

tableextension 70000030 CreditDays extends Vendor
{
fields
{
field(70000900;CreditDays;Integer) 
{
trigger OnValidate();
begin
if (rec.CreditDays < 0) then
begin
message('Credit Days can not be blank');
end; 
end;
}
}
}

Stay tuned for more and Keep updating and learning .

Cheers

Dynamics 365 for operations-Warehouse

Dynamics 365 for operations-warehousing has been made available on windows store and google play store.

The Dynamics 365 for Operations – Warehousing app includes the following features to boost productivity:

  • A tailored interface designed for fast warehouse scanning
  • Supports over 40 different warehouse processes
  • Custom built on-screen numeric keypad for you to hit numbers easily
  • A simple calculator for you to enter and calculate quantities in a breeze
  • Possibility to adjust font size and width of input fields on any device

For more information you can have look at following link

https://blogs.msdn.microsoft.com/dynamicsaxscm/2017/01/20/announcing-dynamics-365-for-operations-warehousing/

All about Microsoft Dynamics NAV