Hi, Readers.
Precise and consistent terminology helps the end user work with the application. Rules for naming and abbreviating objects also help developers to understand the CRONUS International Ltd. demonstration database and develop new features faster.
Guidelines for naming variables in Naming Objects, Fields and Variables:
Guideline | Examples |
---|---|
Omit spaces, periods, and other characters such as parentheses that make quotation marks around a variable necessary. | GenJnlBatch |
Replace currency unit signs such as $ with the corresponding currency unit code. Note: This may not make a variable unique. To be unique, it must be different from the corresponding field name. Also, the variable is not necessarily unique when translated to another language. | AmountUSD |
Start variables with uppercase letters. | |
If a variable is a compound of two or more words or abbreviations, then start each word or abbreviation with an uppercase letter. | |
Describe the variable usage wherever possible. If possible, start with the table name. If there are several variables in an object that would otherwise have the same name, then use appropriate prefixes or suffixes to differentiate them. | CustInvDiscAmountLCY EnteredPostingDate (where the prefix is Entered) |
Follow country/region-specific rules for abbreviations. | |
When you set up table and field variables, give the variable the same name as the table or field as described in the Table Fields section. | |
If a variable with the same name already exists, then add the number 2 to the variable name. If a variable with this name also exists, then use 3, and so on. Use these numbers only if you cannot establish a unique variable in another way. | CustLedgEntry2, NewCustLedgEntry (better than CustLedgEntry2) |
Note that parameters and local variables have their own number series. Do not name a parameter GenJnlLine4 because a global variable named GenJnlLine3 already exists. | |
To use a variable to store a value temporarily, start the variable name with “Temp”. | TempType |
Use “Old” and “New” as prefixes for record variables when you have old tables and new tables. | |
Do not use “x” as a prefix. This is used only in table triggers when the record variable is created automatically by the development environment. | |
Include “Total” in the name of a variable that is used for totaling. | |
Use “From” or “To” when you are copying from or to a table. | |
Use “Starting” or “Ending” with dates and positions. | |
Use “First” or “Last” with the first or last record in a table or line in a journal. You can also use it as a flag to indicate that this is the first record that is processed. | FirstOrder |
When a variable is a Record, Page, Report, XMLport, Query, or Codeunit data type and the object has a name that also functions as a field name or local function name, add the suffix Rec, Page, Report, XMLport, Query, or Codeunit. | SourceCodeRec (for a record variable from the Source Code table) Note: Because “Source Code” is the name of a table and the name of a field in other tables, you should not use “SourceCode” for variables that hold the two different types of information. |
Today I would like to share a very convenient extension in VS Code that can be used in Business Central development, AL Variable Helper.
You can find and install this extension in the Maketplace.
My best favorite Usage: Intellisense to assign correct variable names.
To create a new variable type t + (e.g. trecord), then select a name for the variable tab to the name and select a name with Ctrl + Space. (Note: Please do not enter the object name directly)
trecord:
tpage:
Test video:
To go to global/local variables, hit CTRL + L or CTRL + G.
All features:
- Easy variable assignment
- Go to global/local variables – like in the C/SIDE environment.
- Sort Variables
- Fix keyword casing
Give it a try!
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
コメント