banner banner Skip to main content

Unique,Notify And Control IN TDL

Field Level Attribute — Unique

This attribute takes a logical value. If it is set to Yes, then the values keyed in the field have to be unique. If the entries are duplicated, an error message Duplicate Entry pops up. This attribute is useful when a Line is repeated over UDF/Collection, in order to avoid a repetition of values.

Syntax

Unique: [Yes / No]

Example

[!Field: VCHPHYSStockItem]
Table : Unique Stock Item : $$Line = 1
Table : Unique Stock Item, EndofList
Unique: Yes

In this code snippet, the field VCHPHYSStockItem is an optional field in DefTDL, which is used in a Physical Stock Voucher. The attribute Unique avoids the repetition of Stock Item names.

Field Level Attribute — Notify

It is similar to attribute ‘Validate’. The only difference is that it flashes a warning message and the cursor moves to the subsequent field. A system formula is added to display the warning message.
Syntax

Notify : System Formula : Logical Condition

Example
[!Field: VCH NrmlBilledQty]
Set as : if @@HasInvSubAlloc then $$CollQtyTotal: +
BatchAllocations : $BilledQty else @ResetVal
Skip On : @@HasInvSubAlloc
Style : if @@IsInvVch then "Normal" else "Normal Bold"
Notify : NegativeStock:##VCFGNegativeStock AND +
@@IsOutwardType AND$$InCreateMode AND +
$$IsNegative:@@FinalStockTotal

Here, VCH NrmlBilledQty is a default optional field in TDL used in a Voucher. ‘Notify’ pops up a
warning message, if the entered quantity for a stock item is more than the available stock, and the
cursor moves to the subsequent field.

Field Level Attribute — Control

The attribute ‘Control’ is similar to Notify. The only difference is that it does not allow the user to

proceed further after displaying a message. The cursor does not move to the subsequent field.

Syntax
Control : System Formula : Logical Condition

Example
[Field: VCH Number]
Use : Voucher Number Field
Inactive : @@NoVchNumbering
Skip On : @@AutoVchNumbering
Control : DuplicateNumber : @@NoDupVchNumbering AND +
(NOT $$InAlterMode OR NOT @SameVchTypeAndNum)AND +
$$IsDuplicateNumber:$$Value:
SameVchTypeAndNum : $VoucherTypeName = ##ORIGVchType AND +
$$Value = ##ORIGVchNum
Validate : (@@NoDupVchNumbering AND NOT $$IsEmpty:$$Value) +
OR NOT @@NoDupVchNumbering
Keys : PrevVchNumber

In this example, the field, VCH Number is a default field in TDL, used in a Voucher. The duplication
of voucher numbers for a particular voucher type is prevented by using the attribute Control. The differences between the field attributes Validate, Notify and Control are:

Form Level Attribute — Control

This attribute achieves a higher level of control on the contents of a Form, compared to the other
controls used at the Lower levels of the Form. If the condition specified with ‘Control’ is not satisfied, then the Form displays an error message while trying to save. The Form cannot be saved

until the condition in the attribute ‘Control’ is fulfilled.

Syntax
Control : String Formula : Logical Formula

Example
[Form: Voucher]

Control : DateBelowBooksFrom : $Date < +
$BooksFrom:Company :##SVCurrentCompany
Control : DateBelowFromDate : $Date < $$SystemPeriodFrom
Control : DateBeyondToDate : $Date > $$SystemPeriodTo

In this example, Voucher is a default Form. While creating a voucher, the attribute Control does not accept dates beyond the financial period or before beginning of the books.

Menu Level Attribute — Control

The attribute Control restricts the display of Menu Items, based on the given condition.
Syntax

Control : Item Name : Logical condition

Example
[!Menu: Gateway of Tally]

Key Item : @@locAccountsInfo : A : Menu : Accounts Info. : NOT +
$$IsEmpty:$$SelectedCmps
Control : @@locAccountsInfo : $$Allow:Create:AccountsMasters OR +
$$Allow:Alter:AccountsMasters

Here, the menu item Accounts Info will be displayed only if the condition is satisfied. $$Allow checks if the current user has the rights to access the report displayed under the current Menu item. The value Accounts Masters has been derived from attribute ‘Family’ at ‘Report’ definition.


Popular posts from this blog

Tally ODBC Driver Issue

Based on the Operating System bit (32/64) Tally has given the Exe. However the Micro Soft Excel application should be compatible to O/S and Tally.ERP9. Please note, On 64 Bit OS and 64Bit Tally.ERP9, a 32 Bit Excel application can act as a server with following steps. Please download from the Portal- ‘Microsoft Access Database Engine 2010 Redistributable’.  1. Install AccessDatabaseEngine_x64.exe Installed (steps given below separately.) 2. Excel 32 Bit (Excel 2003) Installed – and acting as server 3. Tally 64 Bit As Client –                      with ODBC Driver [ODBC: "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=C:Tally.ERP 9 4.5 Build 7Sample Data.xls;"] and  Tally 32 Bit as Client – with ODBC Driver [ODBC : "Driver={Microsoft Excel Driver *.xls)};DBQ=Sample Data.xls"] This will resolve the problem by NOT upgrading MS Office to 64 bit. you can continue using 32 bit application of Excel.

LOG In function

During expression evaluation, intermediated values of the expression can be passed to calculator window and a log file ‘tdlfunc.log’ inside the application directory. This is very much helpful for debugging the expression. By default, logging is enabled inside the function. Syntax LOG : < Expression> Where, is the expression whose value needs to be passed to the calculator window. [Function : GetCurrentUserApprovelAmt] Parameter : PsvCurrentUser : String Variable : ApprovelAMT : Amount Return : Amount  10 : Walk Collection : ApprovelRequredColl  11 : If : $CustVAUser =  ##PsvCurrentUser  12 : Set : ApprovelAMT : $ApprovelAmount  12A : Log : ##ApprovelAMT  13 : End If  14 : End Walk  15 : Return : ##ApprovelAMT

Differences between Applications and DLLs

Differences between Applications and DLLs Even though DLLs and applications are both executable program modules, they differ in several ways. To the end user, the most obvious difference is that DLLs are not programs that can be directly executed. From the system's point of view, there are two fundamental differences between applications and DLLs: An application can have multiple instances of itself running in the system simultaneously, whereas a DLL can have only one instance. An application can own things such as a Stack, Global memory, File handles, and a message queue, but a DLL cannot.