Download presentation
Presentation is loading. Please wait.
Published byClement Johnson Modified over 9 years ago
1
1 of 20 Microsoft ® Business Solutions–Navision ® Development I – C/SIDE Introduction Day 2
2
2 of 20 Class Schedule
3
3 of 20 Course Structure – Day 2 Course Introduction Introduction to Microsoft Navision Development Basic Design Architecture The C/AL Programming Language Data Manipulation Integration Review
4
4 of 20 Definitions C/AL = Client Application Language C/SIDE = Client/Server Integrated Development Environment
5
5 of 20 What is it used for? C/SIDE objects already account for: –Data presentation is handled through the form objects and report objects –Data acquisition is mainly handled through form and dataport objects –Data storage and organization is handled by the table objects in conjunction with the built-in DBMS Customize for: –Data manipulation –Control the execution of C/SIDE objects
6
6 of 20 C/AL Programming – Data Types, Simple vs Complex Simple Data Types: –Data which have only one value and cannot be broken into other values of different types Complex Data Types: –Data that has more than just a value and operators –Can include both member variables and member functions
7
7 of 20 C/AL Programming – Numeric Data Types DescriptionExample Integer -2,147,483,647 to 2,147,483,647 12; 1000; -100; 0 BigInteger64 bit integer1L; 455500000000L Decimal18 significant digits12.50; 52000000000 Option Refers to “Option String” property Option := 2 OptionString := Red,Orange,Yellow Value would be Yellow CharSingle character‘b’; ‘C’; ‘3’
8
8 of 20 C/AL Programming – Other Simple Data Types DescriptionExample Text Alphanumeric string up to 1024 characters ‘Hello’;’127.50’ Code Uppercase alphanumeric string up to 1024 characters ‘HELLO’; ‘127.50’ BooleanTRUE or FALSETRUE; FALSE Date Calendar date from 1/1/0000 to 12/31/9999 123197D; 0D TimeTime of day103000T; 0T DateTimeDate and time of day December 31, 2004, 14:20:59.999
9
9 of 20 C/AL Programming – Complex Data Types BLOB Record Form Codeunit File Dialog Report DateFormula GUID TableFilter RecordRef RecordID KeyRef InStream and OutStream Variant BigText
10
10 of 20 C/AL Programming – Variables Global vs Local Variables: –Global variables can be accessed anywhere in the object; local variables can only be accessed in a single trigger System Defined Variables: –Variables that are pre-defined within MBS Navision –Rec, xRec, COMPANYNAME, USERID are examples Initialization –Numeric variables initialize to 0 –String variables initialize to the empty string (‘’) –Boolean variables initialize to FALSE –Date, Time, and DateTime initialize to 0D, 0T, 0DT
11
11 of 20 C/AL Programming – Expressions ItemJnlLine.Amount := -(Amount * (QtyToBeInvoiced / "Qty. to Invoice") - RemAmt); Expression TermSub-expression Operator
12
12 of 20 C/AL Programming – Logical Operator NOTTrueFalseORTrueFalse ResultFalseTrue FalseTrueFalse ANDTrueFalseXORTrueFalse True FalseTrueFalseTrue False TrueFalse
13
13 of 20 C/AL Programming – Arrays QuantityArray[10] Identifier = QuantityArray Element = Designated in the “Dimensions” property Index = Reference to a single element (10) Dimensions = Designated in the “Dimensions” property
14
14 of 20 C/AL Programming – Repetitive Statements SyntaxComments FOR… TO FOR idx := 4 TO 8 DO BEGIN Total := Total + 2.5; GrandTotal := GrandTotal + Total; END; Start and end value evaluated at the beginning FOR… DOWNTO FOR idx := 9 DOWNTO 1 DO BEGIN TotalSales := TotalSales + Sales[idx]; NumberSales := NumberSales + 1; END; Start and end value evaluated at the beginning WHILE… DO WHILE Sales[idx + 1] <> 0 DO BEGIN idx := idx + 1; TotalSales := TotalSales + Sales[idx]; END; Boolean expression evaluated at the beginning REPEAT… UNTIL REPEAT idx := idx + 1; TotalSales := TotalSales + Sales[idx]; UNTIL Sales[idx] = 0; Boolean expression evaluated at the end
15
15 of 20 C/AL Programming – Essential C/AL Functions Searching… SyntaxDescription GET[Ok :=] Record.GET([Value],...) Retrieves one record based on the primary key, regardless of filters FINDOk := Record.FIND([Which]) Retrieves a record based on filters NEXTSteps := Record.NEXT([Steps]) Steps through records of a table
16
16 of 20 C/AL Programming – Essential C/AL Functions Sorting & Filtering… SyntaxDescription SETCURRENTKEY [Ok :=] Record.SETCURRENTKEY (Field1, [Field2],...) Used to select a key for a record, which sets the sorting of the records SETRANGERecord.SETRANGE (Field [,FromValue] [.ToValue]) Sets a filter on the table SETFILTERRecord.SETFILTER (Field, String, [Value],...) Sets a filter using a string field
17
17 of 20 C/AL Programming – Essential C/AL Functions Inserting, Modifying, Deleting… SyntaxDescription INSERT[Ok :=] Record.INSERT( [RunTrigger]) Inserts a record into a table MODIFY[Ok :=] Record.MODIFY( [RunTrigger]) Modifies an existing record in a table DELETE[Ok :=] Record.DELETE( [RunTrigger]) Deletes a record in a table
18
18 of 20 C/AL Programming – Other Essential C/AL Functions LOCKTABLE CALCFIELDS CALCSUMS FIELDERROR FIELDNAME INIT TESTFIELD VALIDATE
19
19 of 20 C/AL Programming – Creating Your Own Functions Organization/Simplification Code Re-use Easier to Debug Modifications are Easier Localization Size Reduction
20
20 of 20 Reports Properties Triggers Properties Controls Properties Triggers Properties Triggers Controls Triggers Data Items Global Var. Request Form Sections Report Description
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.