AL Programming for Dynamics Business Central On Premises – Data Types
Dictionary Data TypeThe Dictionary data type represents a collection of keys and values. Dictionary consists of a value and its associated key. Every key in a Dictionary must be unique. Following is an example:
- Create a codeunit using the ‘tcodeunit’ snippet and then provide the ID number and name of the codeunit.
- Create a procedure using the ‘tproceure’ snippet.Figure 1 – Creating a procedure by using a snippet in Dynamics Business Central on premises
- Each addition to the Dictionary consists of a value and its associated key.
- Every key in a Dictionary must be unique.
- A key cannot be null, but a value can be, only when the value type is a reference type.
RecordID & RecordRefRecord Ref references a record in a table. There are many records available; some are presented below: Number Method: Identify the number of record Syntax: No: = RecordRef.Number() Name Method: Identify the name of record Syntax: Name := RecordRef.Name() Record ID contains the table number and the primary key of a table. Two instances are there.
Table no() :provides the table number of the table that is identified by the Record ID.
Get Record () : Gets a RecordRef that refers to the record identified by the Record ID.
- Create a codeunit to show an instance.
- Let’s go through an example of table no.
Figure 2 – RecordID & RecordRef data types in Dynamics Business Central on premises
BigText Data TypesThe BigText data type handles large text documents. There are many methods available; three of them presented below. AddTextMethod : Add text to the string. Syntax : BigText.AddText(String: String, [Position: Integer]) Length () : Retrieves the length. Syntax : Length := BigText.Length() Textposition : Gets the position at which a specific string first occurs in this BigText instance Syntax : Position := BigText.TextPos(String: String) GetSubtext : Gets part of a BigText variable Syntax : [Length := ] BigText.GetSubText(var Variable: BigText, Position: Integer, [Length: Integer])
Figure 3 –BigText data types in Dynamics Business Central on premises If you have any questions about this or other Dynamics NAV or Business Central topic for any version, contact ArcherPoint. Read more "How To" blogs from ArcherPoint for practical advice on using Microsoft Dynamics Business Central or NAV. If you are interested in NAV/Business Central development, check out our collection of NAV Development Blogs.
- Login Error: Communication protocol mismatch between client and server
- Creating a Date Table in Power BI
- The Top Eight KPIs Retailers Should Be Tracking (with Formulas) for Your Retail KPI Dashboard
- Difference Between IaaS, PaaS, and SaaS And When You Need to Use Them
- The Microsoft Technology Stack – What It Is and Why You Should Care