Hi, Readers.
Dynamics 365 Business Central 2024 wave 1 (BC24) is generally available. More details: General availability: Dynamics 365 Business Central 2024 release wave 1 (BC24)
I will continue to test and share some new features that I hope will be helpful.
In this post, I would like to share a new compiler warning (Future Error) in Business Central 2024 release wave 1 (BC24). This is not yet documented in the Business Central 2024 release wave 1 (BC24) release plan. But it is mentioned in AL Language extension changelog Version 13.0
Added warning AL0803 when the names of two events or event subscribers conflict within the same object. Whitespaces in names are internally replaced with an underscore during compilation, such that two different names can collide. For example, “my event” and “my_event” are conflicting names. From runtime 15.0, an error will be reported with AL0757.
https://marketplace.visualstudio.com/items/ms-dynamics-smb.al/changelog
AL0803
White spaces in names are internally replaced with an underscore during compilation, so that two different names can collide. This diagnostic is specific to event and event subscriber methods.
Like other languages, AL methods are a fundamental programming element. A method, also known as a procedure, is a named group of statements that perform an operation or task.
To declare a method, follow these guidelines:
- Include a space after a semicolon when declaring multiple arguments.
- Semicolons can be used at the end of the signature/method header. If you use a snippet, the semicolons aren’t automatically added.
- Methods are named as variables using Pascal case. However, this isn’t a mandatory rule.
- There must be a blank line between method declarations. If you format your code using the AL Formatter tool, the autoformatter sets the blank line between procedures.
Example,
local procedure MyProcedure(Customer: Record Customer; Int: Integer)
begin
end;
// space
local procedure MyProcedure2(Customer: Record Customer; Int: Integer)
begin
end;
This is a minor update in this wave, but needs attention. For example,
The name of Method ‘my_event’ conflicts with Method ‘my event’ defined in Codeunit ‘MyCodeunit’ by the extension ‘BC24 Test by YUN ZHU (1.0.0.2)’. Choose another name for one of them. Otherwise, this might cause runtime issues. This warning will become an error when targeting a runtime with version ‘15.0’ or higher.
As mentioned above, this diagnostic is specific to event and event subscriber methods as of now.
But for variables, doing so causes the following error.
The name of GlobalVariable ‘my Int’ conflicts with GlobalVariable ‘my_Int’ defined in Codeunit ‘MyCodeunit’ by the extension ‘BC24 Test by YUN ZHU (1.0.0.2)’. Choose another name for one of them. Otherwise, this might cause runtime issues.
So whether it is in the event and event subscriber methods or not, I personally recommend not appending spaces or other symbols to method names. For example, please refer to the names of standard methods below.
This will become an error from runtime 15.0 (Business Central 2025 release wave 1). Please check the code again.
PS: Some Suggested Abbreviations
Abbreviation | Text |
Abs | absence |
Acc | account |
Acc | accounting |
Accum | accumulated |
Act | action |
Activ | activity |
Add | additional |
Addr | address |
Adj | adjust |
Adjd | adjusted |
Adjmt | adjustment |
Agrmt | agreement |
Alloc | allocation |
Allow | allowance |
Alt | alternative |
Amt | amount |
Amts | amounts |
Ans | answer |
Appl | applies |
Appln | application |
Arriv | arrival |
Asm | assembly |
ATO | assemble to order |
Assgnt | assignment |
Assoc | associated |
Attmt | attachment |
Auth | authorities |
Auto | automatic |
Avail | availability |
Avg | average |
BA | ba db. |
Bal | balance |
BOM | bill of materials |
Blnkt | blanket |
Budg | budget |
Buf | buffer |
Bus | business |
BIM | business interaction management |
Buy | buying |
Calc | calculate |
Calcd | calculated |
Calcu | calculation |
Cal | calendar |
Cap | capacity |
CRP | capacity requirements planning |
CF | cash flow |
CF | cashflow |
ctlg | catalog |
Cat | category |
CPU | Central Processing Unit |
Ctr | center |
Chg | change |
Chgs | changes |
Char | character |
Chars | characters |
Chrg | charge |
Chrgs | charges |
Chk | check |
Class | classification |
coll | collection |
col | column |
Cmt | comment |
Co | company |
Comp | component |
Cmpltn | completion |
Comps | components |
Compn | composition |
Compr | compression |
Concrnt | concurrent |
Conf | confidential |
Cnfrmn | confirmation |
Confl | conflict |
Consol | consolidate |
Consolid | consolidation |
Consump | consumption |
Cont | contact |
Cntr | container |
Contr | contract |
Contrd | contracted |
Ctrl | control |
Ctrls | controls |
Conv | conversion |
Cor | correction |
Corres | correspondence |
Corresp | corresponding |
Cst | cost |
COGS | sold |
Cr | credit |
Cumul | cumulate |
Curr | currency |
Crnt | current |
Cust | customer |
CV | customer/vendor |
Dly | daily |
Damp | dampener |
DBMS | database management system |
D | date |
Def | definition |
Demo | demonstration |
Dept | department |
DP | department/project |
Depr | depreciation |
Desc | description |
Dtl | detail |
Dtld | detailed |
Dtls | details |
Dev | deviation |
Diff | difference |
Dim | dimension |
Dir | direct |
Disc | discount |
Discr | discrete |
Distr | distribute |
Distrd | distributed |
Distbtr | distributor |
Distrn | distribution |
Doc | document |
Dupl | duplicate |
Entrd | entered |
Engin | engineering |
Exch | exchange |
Excl | excluding |
Exec | execute |
Expd | expected |
Exped | expedited |
Exp | expense |
Expr | expression |
Expir | expiration |
Ext | extended |
Expl | explode |
Expt | export |
Fnl | final |
Fin | finance |
Fisc | fiscal |
Fnshd | finished |
FA | fixed asset |
Fwd | forward |
Frt | freight |
Gen | general |
GL | general ledger |
Gr | group |
Hdr | header |
Hist | history |
Hol | holiday |
HR | human resource |
ID | identification |
Imp | import |
Inbnd | inbound |
Incl | including |
Incld | included |
Incmg | incoming |
ISV | independent software vendor |
Indust | industry |
Info | information |
Init | initial |
Intra | Intrastat |
Interact | interaction |
Integr | integration |
Int | interest |
Intm | Interim |
IP | internal protocol |
Invt | inventory |
Invtbl | inventoriable |
Inv | invoice |
Invd | invoiced |
IT | item tracking |
Jnl | journal |
Lang | language |
Ledg | ledger |
Lvl | level |
Ln | line |
Lt | list |
LCY | local currency |
Loc | location |
mailing | |
Maint | maintenance |
Mgt | management |
Man | manual |
Mfg | manufacturing |
Mfr | manufacturer |
Mat | material |
Mktg | marketing |
Max | maximum |
Meas | measure |
Msg | message |
Min | minimum |
Misc | miscellaneous |
Mod | modify |
Mth | month |
Neg | negative |
NonInvtbl | non-inventoriable |
Notif | notification |
No | number |
Nos | numbers |
Obj | object |
Oper | operating |
Opp | opportunity |
Ord | order |
Ords | orders |
Orig | original |
Org | organization |
Outbnd | outbound |
Outg | Outgoing |
Out | output |
Outstd | outstanding |
Ovhd | overhead |
Pmt | payment |
Pct | percent |
Persnl | personnel |
Phys | physical |
Pic | picture |
Plng | planning |
Pstd | posted |
Post | posting |
Pos | positive |
Prec | precision |
Prepmt | prepayment |
Prod | product |
Prod | production |
ProdOrd | production order |
Proj | project |
Prop | property |
Prspct | prospect |
Purch | purchase |
Purch | purchases |
Purchr | purchaser |
PurchOrd | purchase order |
Qlty | quality |
Qty | quantity |
Questn | questionnaire |
Qte | quote |
RF | radio frequency |
Rng | range |
Rcpt | receipt |
Rcd | received |
Rec | record |
Recs | records |
Recncl | reconcile |
Recon | reconciliation |
Recur | recurring |
Ref | reference |
Reg | register |
Regn | registration |
Regd | registered |
Rel | relation |
Rels | relations |
Rlshp | relationship |
Rlse | release |
Rlsd | released |
Rem | remaining |
Rmdr | reminder |
Repl | replacement |
Rplnsh | replenish |
Rplnsht | replenishment |
Rpt | report |
Rep | represent |
Repd | represented |
Rqst | request |
Reqd | required |
Reqt | requirement |
Reqts | requirements |
Req | requisition |
Rsv | reserve |
Rsvd | reserved |
Reserv | reservation |
Resol | resolution |
Res | resource |
Rsp | response |
Resp | responsibility |
Rtn | retain |
Rtnd | retained |
Ret | return |
Rets | returns |
Revaln | revaluation |
Rev | reverse |
Rvw | review |
Rnd | round |
Rndd | rounded |
Rndg | rounding |
Rte | route |
Rtng | routing |
Rout | routine |
Sales | sales & receivables |
Saf | safety |
Sched | schedule |
Sec | second |
Seg | segment |
Sel | select |
Selctn | selection |
Seq | sequence |
Ser | serial |
SN | serial number |
Serv | service |
Sh | sheet |
Shpt | shipment |
Src | source |
Spcl | special |
Spec | specification |
Specs | specifications |
Std | standard |
SF | frequency |
Stmt | statement |
Stat | statistical |
Stats | statistics |
Stk | stock |
SKU | stockkeeping unit |
Stm | stream |
SQL | structured query language |
Subcontr | subcontract |
Subcontrd | subcontracted |
Subcontrg | subcontracting |
Sub | substitute |
Subst | substitution |
Sug | suggest |
Sugd | suggested |
Sugn | suggestion |
Sum | summary |
Suspd | suspended |
Sympt | symptom |
Synch | synchronize |
Temp | temporary |
Tot | total |
Transac | transaction |
Trans | transfer |
Transln | translation |
Trkg | tracking |
Tblsht | troubleshoot |
Tblshtg | troubleshooting |
UOM | unit of measure |
UT | unit test |
Unreal | unrealized |
Unrsvd | unreserved |
Upd | update |
Valn | valuation |
Val | value |
VAT | value added tax |
Var | variance |
Vend | vendor |
Whse | warehouse |
WS | web shop |
Wksh | worksheet |
GL | g/l |
Pct | % |
Three-Tier | 3-tier |
Osynch | Outlook Synch |
END
Hope this will help.
Thanks for reading.
ZHU
コメント