Explore Categories

 

In-built Functions

In-built functions are functions predefined by the platform in order to accomplish a specific task. A wide range of functions are available in the TDL functions library for varied purposes like business-related, mathematical, string etc. The application developer has no control over the execution sequence of these functions. They can only be used as required to achieve their specific task. Some functions may not require any parameters like $$NewLine which moves to the next line. Some functions may require one or more parameters; depending on the design of the function. For example, $$Inwords accepts one parameter of the amount type and returns the amount in words.

Functions give the following benefits to the TDL programmer:

  • Conditional execution/evaluation of statements
  • Execution of a set of statements repeatedly, generally referred to as loops
  • Defining variables and storing values from intermediate calculation/process
  • Accepting parameters from the calling segment of code
  • Working on data elements like getting an object from the calling context, defining the function execution context, looping on the objects of a collection, etc.
  • Returning a ‘Value’ to the caller of the function
  • Performing a set of actions sequentially/conditionally or repeatedly, without returning a value.

Note: To know more about in-built functions, refer to the function browser from TallyPrime Developer.

System Function: SysInfo

Use the function SysInfo to retrieve system-related information, like system date, operating system version, and so on. $$SysInfo accepts one parameter at a time, out of the 19 explained below.

Syntax

$$SysInfo : <Parameter>

where <parameter> is one of the values explained in the table below.

No.

Parameter

Description

Example

1

ApplicationPath

The folder path where the current copy of Tally is running.

C:/TallyPrime

2

CurrentPath

The data path configured in tally.ini, residing in the application path.

C:/TallyPrime/Data

3

SystemDate

The system date.

27-May-2017

4

SystemTime

The system time.

18:27

5

SystemTimeHMS

The system time in hh:mm:ss format.

18:27:36

6

SystemName

The system name.

TallyClient2

7

IsWindows

Checks whether the system has Microsoft Windows operating system.

Yes

8

WindowsVersion

The Microsoft Windows version with the build number.

6.2 (9200)

9

WindowsUser

The name of the Windows user who has logged in.

geetha.ram

10

IPAddress

The IP Address of the system.

192.168.1.17

11

MACAddress

The Media Access Control Address of the network adapter in the system.

0720fhac027a

12

RunningIPV4Addr

The currently running Internet Protocol Version 4 address.

192.168.1.17

13

RunningIPV6Addr

The currently running Internet Protocol Version 6 address.

2001:db8:85a3:8d3:1319:8a2e:370:7348

14

IsOSx64

Checks whether the operating system is 64-bit.

Yes

15

IsAdmin

Checks whether the operating system is running in Admin mode.

No

16

TallyinAdminMode

Checks whether TallyPrime is running in Admin mode.

No

17

UACStatus

Checks whether the User Account Control is enabled.

Yes

18

SystemProxySettings

The proxy settings in the system.

192.168.1.17:8000

19

ModuleName

The folder path and file name of the current application.

C:/TallyPrime/tally.exe

 

Function Enhancements in Tally.ERP 9 Releases

Release 1.5

New Functions

In this release, two new functions have been introduced – $$TgtObject and $$ContextKeyword.

Function – $$TgtObject

The new Context Evaluation function $$TgtObject evaluates the expression in the context of the Target Object. Using $$TgtObject, values can be fetched from the target object without making the target object as the context object.

Syntax

$$TgtObject : <String Expression>

Where,

<String Expression> is the expression which will be evaluated in the context of Target Object.

Usage of $$TgtObject in User Defined Functions

In a user-defined function, while setting the method values of the target object, the expression needs to be evaluated in the context of the target object itself. $$TgtObject is used in this case.

Example

Ledgers ‘Party 1’ and ‘Party 2’ are having some opening balance. The requirement is to add the opening balances of both ledgers and set the resultant value as the opening balance of Party 2.

[Function : Sample Function]

Object : Ledger : “Party 1”

00 : NEW OBJECT : Ledger : “Party 2”

01 : SET VALUE : OpeningBalance : $OpeningBalance + $$TgtObject:$OpeningBalance

02 : ACCEPT ALTER

;; By prefixing $$TgtObject to the opening balance, the closing balance of the Target Object, i.e., Party 2, is retrieved.

Here, ‘Party 1’ is the Source object and ‘Party 2’ is the Target object. The opening balance of ‘Party 2’ is accessed using the expression $$TgtObject:$OpeningBalance.

Usage of $$TgtObject in Collections

In simple collections, the source object and the target object are both the same. In the case of aggregate collections and user-defined functions, the target object is different.

The function $$TgtObject allows accessing the values from the target object itself, while the collection is being populated. It is required in the aggregate collection, where the source object is not the same as the target object.

The function $$TgtObject is useful when the values are to be populated in the collection, based on the values that have been computed earlier. In aggregate collections, the function $$TgtObject can be used in the attributes Fetch, Compute and Aggr Compute of collection.

Example:

A report is to be designed for displaying the stock item, the date on which the maximum quantity of the item is sold and the maximum amount is received. The collection is defined as follows:

[Collection : Src Voucher]

Type : Vouchers : VoucherType

ChildOf : $$VchTypeSales

[Collection : Summ Voucher]

Source Collection : Src Voucher

Walk : Inventory Entries

By : ItemName : $StockItemName

Aggr Compute : MaxDate : SUM : IF $$IsEmpty:$$TgtObject:$ItemDet OR +                                                 $$TgtObject:$ItemDet < $Amount THEN $Date +                                           ELSE $$TgtObject:$MaxDate

Aggr Compute : ItemDet : MAX : $Amount

While creating a collection “Summ Voucher”, $$TgtObject is used to get the date on which the maximum sales amount is received for each stock item. $ItemDet gives the maximum amount received for the individual item. In the condition checking part, if the evaluated $ItemDet is empty for the stock item or is less than the current amount of the stock item of the source object, then the current date is selected, otherwise, the value of $MaxDate is retained.

Following Table shows the evaluation of values with respect to the target object:

Source Object

Current Objects

Target Objects

3 Sales Voucher

8 Inventory Entries

3

Sales Voucher -1 Dated – 7/7/09

Item 1 – Rs.500

Item 2 – Rs.500

Item 3 – Rs.500

Item 1 – 7/7/09 – Rs 500

Item 2 – 9/7/09 – Rs 700

Item 3 – 8/7/09 – Rs 800

Sales Voucher -2 Dated – 8/7/09

Item 1 – Rs.400

Item 3 – Rs.800

Sales Voucher -3 Dated – 9/7/09

Item 1 – Rs.300

Item 2 – Rs.700

Item 3 – Rs.500

Function – $$ContextKeyword

A new function $$ContextKeyword can be used to get the title of the current Report or Menu. It is used to search the context-sensitive/online help based on the Report or Menu title.

Syntax

$$ContextKeyword [:Yes/No]

The default value is NO . If the value is specified as YES , then the title of the parent report is returned. If no report is active, then the parameter is ignored. If the attribute Title is not specified in the Report definition, then by default, it returns the name of the Report.

Example

[Report : Context Keyword Function]

Form : Context Keyword Function

Title : “New Function Context Keyword”

             |

             |

[Field : Context Keyword Function]

Use : Name Field

Set As : $$ContextKeyword

In this example, the functions return the Title of the current report, i.e., “New Function Context Keyword”. If the parameter value Yes is specified, then the title of the ‘Report’ from where the report “Context Keyword Function” is called, will be returned.

 

Release 1.52

New Functions

New functions $$AccessObj , $$FirstObj and $$LastObj have been introduced in this release.

Function – $$AccessObj

The capability to access data objects associated with Interface objects was introduced in Tally.ERP 9. The attribute ‘Access Name’ is used to specify name to ‘Part’ or ‘Line’ Definition. This name can be used to refer to the Data Object associated with the Part or the Line.

A new function $$AccessObj has been introduced to evaluate the specified formula in the context of the Interface object identified by the given definition type and access name.

Syntax

$$AccessObj : <Definition Type> : <AccessNameFormula> : <Evaluation Formula>

Where,

<Definition Type> can be Part or Line.

<Access Name Formula> can be any formula which evaluates to a string.

<Evaluation Formula> is a formula which is evaluated in the context of the object identified by the definition type and the access name.

Example

[Line : AccessObj]

Fields : AccessObj AccessName : “AO1”

On : Focus : Yes : CALL : AccessObj

[Field : AccessObj]

Set As : $Name

[Function : AccessObj]

Variable : AccessObj : String

00 : SET : AccessObj : $$AccessObj:Line:”AO1″:$Name

10 : LOG : ##AccessObj

The Line ‘AccessObj’ is identified by the access name ‘AO1’. The access name is used while evaluating the value of $Name.

Functions – $$FirstObj and $$LastObj

The objects of the collection are available in the context of repeat line or while performing a walk inside a function. The functions $$FirstObj and $$LastObj can be used to find the first or the last object of the collection respectively.

Function – $$FirstObj

The function $$FirstObj returns the value of the specified method for the first object of the collection.

Syntax

$$FirstObj : <MethodName>

Where,

<Method Name> is the name of a method of the current object in context.

Example

40 : LOG : “First Object : ” + $$FirstObj:$Name

$$FirstObj logs the name of the first object of the collection, which is used in Walk Collection.

Function – $$LastObj

The function $$LastObj returns the value of the specified method for the last object of the collection.

Syntax

$$LastObj : <MethodName>

Where,

<Method Name> is the name of a method of the current object in context.

Example

50 : LOG : “Last Object: ” + $$LastObj:$Name

The function $$LastObj logs the name of the last object of the collection, which is used in Walk Collection.

Release 3.6

Function – $$PrinterInfo

Function $$PrinterInfo has been introduced to extract the settings information for any installed printer. This function is very useful to get the information of the printer, based on which, we can determine the dimensions for pre-printed invoice, etc.

Syntax

$$PrinterInfo : <Printer Name> : <Information Type>

Where,

<Printer Name> refers to the name of the printer for which the information is required.

<Information Types> are permissible information types like PrintSizeinInches, LeftMarginInMMs, etc.

Example

$$PrinterInfo : HPLaserJet4250PCL6 : PrintSizeInInches

The list of permissible Information Types are:

  • LeftMarginInMMs returns the Number which denotes the space to be left on the Left side of the page in Millimeters.
  • TopMarginInMMs returns the Number which denotes the space to be left on the Top of the page in Millimeters.
  • RightMarginInMMs returns the Number which denotes the space to be left on the Right side of the page in Millimeters.
  • PrinterExists returns Logical value (YES/NO), indicating if the Printer Exists or not.
  • PrintSizeInInches returns the dimensions which denotes the Print Area in Inches, i.e., excluding the Margins.
  • PrintSizeInMMs returns the dimensions which denotes the Print Area in Millimeters, i.e., excluding the Margins.
  • PrintSizeInLines returns the dimensions which denotes the Print Area in Lines, i.e., excluding the Margins.
  • PaperSizeInInches returns the dimensions which denotes the Paper Size in Inches, which includes the Margins.
  • PaperSizeInMMs returns the dimensions which denotes the Paper Size in Millimeters, which includes the Margins.
  • PaperSizeInLines returns the dimensions which denotes the Paper Size in Lines, which includes the Margins.
  • PaperType returns the selected Type of the Paper, e.g., A4, A5 Small, etc.
  • PortName returns the Port Name configured for the Printer.
  • Orientation returns the Orientation Type of Paper, i.e., Landscape or Portrait.

The following screen capture displays the selected Printer details for all the information types:

Figure_2._Printer_Details_(3.6).jpg

Function – $$IsInternetActive

$$IsInternetActive is a function which helps to determine if the Internet is currently active. It returns TRUE if the Internet is accessible, else returns FALSE. It can be used to perform conditional operations, i.e., based on the Internet Connectivity, certain actions can be triggered.

This function checks if the internet is active, such that the operations pertaining to connecting to web pages, emailing, uploading files to FTP, etc., can be performed.

Syntax

$$IsInternetActive

Example

[Function : EmailifConnected]

00 : IF : $$IsInternetActive

;; Function called to Email O/s Stmts

10 : Call : Email Outstanding Statements

20 : ENDIF

In this example, the Outstanding Statements are E-Mailed, if Internet connection is present.

Function – $$CaseConvert

Prior to this release, the function $$Upper has been used to convert the string expressions to upper case, but there were no functions available for other conversions like Lower case, Title Case, etc. To overcome the difficulty of converting the string to Lower case, Title case, etc., a new function $$CaseConvert has been introduced, to convert the case of the given expression to the specified case format. This function will return a string expression in the converted format.

This function is very useful when one needs to follow the case rules to display the Name of the company, Name of the bank, etc.

Syntax

$$CaseConvert : <CaseKeyword> : <Expression>

Where,

<CaseKeyword> can be All Capital, Upper Case, All Lower, Lower Case, Small Case, First Upper Case, Title Case, TitleCaseExact, Normal, Proper Case, etc.

  • All Capital/Upper Case converts the input expression to upper case.
  • All Lower/Lower Case/Small Case converts the input expression to lower case.
  • First Upper Case converts the first letter of the first word in a sentence to upper case. Other characters will remain as they are.
  • Title Case converts the input expression to Title case, i.e., the principal words should start with capital letters.
  • It will not convert the prepositions, articles or conjunctions, unless one is the first word.
  • It will ignore a subset of words from capitalization like the, an, and, at, by, to, in, of, for, on, cm, cms, mm, inch, inches, ft, x, dt, eis, dss, with, etc. For this subset of words, the original strings’ cases will be preserved.
  • TitleCaseExact converts the input expression to Title case, i.e., the principal words will start with capital letters.
  • It will not convert the prepositions, articles or conjunctions, unless one is the first word.
  • It will ignore a subset of words from capitalization like the, an, and, at, by, to, in, of, for, on, cm, cms, mm, inch, inches, ft, x, dt, eis, dss, with, etc. This subset of words will be converted to small case.
  • Proper Case converts the input expression to Title case, i.e., all the words in a sentence should start with capital letters.
  • Normal preserves the input expression as it is.

<Expression> is any expression of type ‘String’.

Example: 1

To convert the expression to upper case:

[Field : String Convert]

Set as : $$CaseConvert:UpperCase:“Tally solutions Pvt. Ltd.”

In this example, the function returns “TALLY SOLUTIONS PVT. LTD.” in the field ‘String Convert’.

Example: 2

To convert the expression to Lower case:

[Field : String Convert]

Set as : $$CaseConvert:LowerCase:“Tally Solutions Pvt. Ltd.”

Here, the function returns, “tally solutions pvt. ltd.” in the field ‘String Convert’.

Example: 3

To convert the expression to Title Case:

[Field: String Convert]

Set as : $$CaseConvert:TitleCase:“To convert the striNg to Title case”

Here, the function returns “To Convert the String to Title Case” in the field ‘String Convert’.

Example: 4

To convert the expression to Title Case Exact:

[Field : String Convert]

Set as : $$CaseConvert:TitleCaseExact:“To convert the string to Title case”

Here, the function returns “ To Convert the String to Title Case” in the field ‘String Convert’.

Example: 5

To convert the expression to first upper case:

[Field : String Convert]

Set as : $$CaseConvert:FirstUpperCase:“Tally solutions pvt. ltd.”

Here, the function returns “Tally solutions pvt. ltd.” in the field ‘String Convert’.

Function – $$RandomNumber

A random number is a number generated by a process whose outcome is unpredictable, and which cannot be subsequently reliably reproduced. In other words, Random numbers are numbers that occur in a sequence such that, the values are uniformly distributed over a defined interval and it is impossible to predict future values based on past or present ones.

In this release, a new TDL function $$RandomNumber has been introduced to generate Random Numbers. In case of auditing, this can be useful for auditors who would like to pick up some vouchers randomly for authentication.

Syntax

$$RandomNumber[:<MinRange>[:<MaxRange>]]

Where,

<Min Range> and <Max Range> are optional. In the absence of Max Range, Long Max is considered, i.e., (2^31) – 1 = 2147483647. In the absence of Min Range, ZERO(0) is considered.

We can generate random numbers in different ways:

No Parameters: Don’t pass any parameters, i.e., just invoke $$ RandomNumber . Default values are assumed.

Only with the MinRange Parameter: Here, there is no need of passing Max range. In this scenario, Random number is generated from the given Min Range.

Both MaxRange and MinRange as Parameter: In this scenario, random numbers are generated for given range.

Example: 1

With no Parameters

Set As : $$RandomNumber

This code will return a Random Number between 0 and 2147483647.

Example: 2

With MinRange Parameter only

Set As : $$RandomNumber:9999

This code returns Random Numbers between 9999 and 2147483647, the random number being greater than or equal to 9999. Here, value of MinRange is 9999 and MaxRange is 2147483647.

Example: 3

With both Parameters (MinRange and MaxRange)

Set As : $$RandomNumber:9:9999

This code returns Random Numbers between 9 and 9999.

 

Release 3.61

Function – $$FileRead Raw

We have a function $$FileRead to read the contents from a text file, which was designed to ignore quotes, comments, spaces, etc., while reading the entire line. Now, a new function $$FileReadRaw has been introduced, similar to the Function $$FileRead, except that the Function $$FileReadRaw can read lines with:

  • Quotes
  • Comment characters (; /* */)
  • Spaces & Tabs

Syntax

$$FileReadRaw[:<Number>]

Where,

<Number> denotes the number of characters to be read.

Example

[Function : Test FileReadRaw]

Variable : GetPath : String

Variable : Get_DownLoad_FileLine : String

000 : Set : GetPath : “C:\TextSource.txt”

010 : Open File : ##GetPath : Text : Read

020 : While : (TRUE)

030 : Set : Get_DownLoad_FileLine : $$FileReadRaw

Using this function, we can read lines with quotes, comment characters, spaces, tabs, etc. If $$FileReadRaw is specified with a parameter, the behaviour is the same as that of Function $$FileRead. If specified without parameters, the entire line is read without ignoring quotes, spaces, etc.

 

Function – $$IsAccountingVch

This function checks if the specified voucher type is Accounting Voucher or not. It returns a logical value.

Syntax

$$IsAccountingVch : <VoucherTypeName>

Where,

<VoucherTypeName> is the name of the voucher type.

Example

Set As : $$IsAccountingVch:##TSPLSmp_Information

Function – $$IsInvVch

This function checks if the specified voucher type is Inventory voucher or not (excluding Order vouchers). It returns a logical value.

Syntax

$$IsInvVch : <VoucherTypeName>

Where,

<VoucherTypeName> is the name of the voucher type.

Example

Set As : $$IsInvVch:##TSPLSmp_Information

Function – $$IsPayrollVch

This function is used to check if the specified voucher type is Payroll Voucher or not. It returns a logical value.

Syntax

$$IsPayrollVch : <VoucherTypeName>

Where,

<VoucherTypeName> is the n a me of the vouc h er type.

Example

Set As : $$IsPayrollVch:##TSPLSmp_Information

Function – $$IsOrderVch

This function is used to check if the specified voucher type is Order Voucher or not. It returns a logical value.

Syntax

$$IsOrderVch : <VoucherTypeName>

Where,

<VoucherTypeName> is the name of the voucher type.

Example

Set As : $$IsOrderVch:##TSPLSmp_Information

Function – $$IsProdTallyServer

This function is used to check whether the product is Tally.Server 9 or not. It returns TRUE if the product is Tally.Server 9.

Syntax

$$IsProdTallyServer

Example

[Function : TSPL Smp IsProdTallyServer]

00 : If : $$IsProdTallyServer

10 : Msg Box : “Server Check” : “The Current Productn is Tally Server”

20 : ELSE 

30 : MSGBOX : “Server Check” : “The Current Productn is not Tally Server”

40 : ENDIF

Function – $$ExcelInfo

This function is used to get the Excel ‘version’ and to check whether ‘XLSX’ format is supported.

Syntax

$$ExcelInfo : <Keyword>

Where,

<Keyword> can be IsXLSXSupported or Version. The keyword IsXLSXSupported returns TRUE, if the format “xlsx” is supported, while Version returns the Excel version number.

Example

Set As : $$ExcelInfo:IsXLSXSupported

Function – $$IsServiceRunning

This function is used to check if the specified service is running or not. It returns TRUE if the service is running.

Syntax

$$IsServiceRunning : <Service Name>

Where,

<Service Name> can be any expression which evaluates to the name of the service.

Example

[Function : TSPL Smp IsServiceRunning]

00 : If : $$IsServiceRunning:”Tally.Server 9″

10 : MSG Box : “Service Check” : “The Current Service n is Running”

20 : ELSE

30 : MSGBOX : “Service Check ” : “The Current Service n is not Running”

40 : ENDIF

Function – $$IsServiceInstalled

This function is used to check if the specified service is installed on the system or not. It returns TRUE if the service is installed.

Syntax

$$IsServiceInstalled : <Service Name>

Where,

<Service Name> can be any expression, which evaluates to the name of the service.

Example

[Function : TSPL Smp IsServiceRunning]

00 : If : $$IsServiceInstalled:”AppMgmt”

10 : Msg Box : “Service Check” : “The Current Service n is installed”

20 : ELSE

30 : MSGBOX : “Service Check” : “The Current Service n is not Installed”

40 : ENDIF

Function – $$ReadINI

The function is used to read the INI file, and get the value of any parameter in the INI.

Syntax

$$ReadINI : <PathFile Name> : <Section Name> : <Parameter> [: <Index>]

Where,

<PathFile Name> is the filename of the INI file, along with the path.

<Section Name> is the section name in the INI file.

<Parameter> is the Parameter whose value is to be fetched from the INI.

<Index> is an optional parameter. It can be used when multiple values for the same parameter are accepted.

Example

Set As : $$ReadINI:“C:\Tally.ERP9\tally.ini”:”TALLY”:”User TDL”

Function – $$IsUserAllowed

This function verifies and returns TRUE if user is allowed to perform the specified operation on current Tally.Server9.

Syntax

$$IsUserAllowed : <Username> : <Operation> : <Tally Server Name>

Where,

<User Name> is the name of the user.

<Operation> is the operation that the user wants to perform. This can be any one of BackUp, Restore, Rewrite, Create Company, Split Company and Monitor Tool.

<Tally Server Name> is the name of the Tally.Server 9

Example

Set as : $$IsUserAllowed:$User_name1:”Restore”:##SvTallyServer

Function – $$IsTSAuthorised

This function checks if security is enabled on the specified Tally.Server 9. It returns TRUE if security is enabled, else it returns FALSE.

Syntax

$$IsTSAuthorised : <TallyServer Name>

Where,

<Tally Server Name> is the name of the Tally.Server 9.

Example

[Function : TSPL Smp IsTSAuthorised]

00 : If : $$IsTSAuthorised:##SvTallyServer

10 : MSG Box : “Security Check” : “Security Control is Enabled”

20 : ELSE

30 : MSGBOX : “Secuirity Check ” : “Security Control n is not Enabled”

40 : ENDIF

Function – $$TSPingInfo

This function is used to retrieve the information related to Tally.Server 9 like License mode, Number of license subscription days left, etc.

Syntax

$$TSPingInfo : <TallyServer> : <Keyword>

Where,

<Tally Server Name> is the name of the Tally Server.

<Keyword> can be any one of the keywords – Iseducational, LicenseExpiryDaysLeft and HasINFO.

  • HasINFO returns TRUE or FALSE depending on whether the client is able to get information for this Tally.Server 9 (otherwise Iseducational and LicenseExpiryDaysLeft fail in a TDL expression).
  • IsEducational returns TRUE if the Tally.Server 9 is running in Educational mode.
  • LicenseExpiryDaysLeft returns the number of subscription days remaining.

Example

Set As : $$TSPingInfo:##SvTallyServer:##Ping_Operation

Function – $$IsTSCompany

This function checks whether the current company is opened through Tally.Server 9 or not. It returns a logical value.

Syntax

$$IsTSCompany : <Company Name>

Where,

<Company Name> is the name of the company.

Example

Set As : $$IsTSCompany:$CompanyStorage

Function – $$SelectedNonTSCmps

This function returns the total number of companies which are not loaded via Tally server, i.e., companies from local or shared data folders.

Syntax

$$SelectedNonTsCmps

Example

[Function : TSPL Smp IsProdTallyServer]

00 : If : $$SelectedNonTsCmps

10 : Msg Box : “Company Check” : $$SelectedNonTSCmps + “Total Companies not loaded via Tally server is \n”

20 : ELSE

30 : MSGBOX : ” Company Check ” : “All Companies Have been Opened Via Tally Server “

40 : ENDIF

Function – $$IsTSPath

This function checks whether the given path is Tally.Server path or not.

Syntax

$$IsTSPath : <Path>

Where,

<Path> is any expression, which evaluates to a Tally Server Name or a Data Location Name.

Example

Set As : $$IsTSPath:”Data1:”

Release 4.8

Function – $$IsTDLLoaded

A new function ‘IsTDLLoaded’ has been introduced to check if a particular TDL is already loaded. This function returns TRUE if the particular TDL/TCP file is already loaded, and FALSE if it is not.

Based on the result of this function, further actions like Loading and Unloading of TDL, or executing a Report from the dynamically loaded TDL File, etc., can be performed.

Syntax

$$IsTDLLoaded : <TDL/TCP File Path Expression or GUID Expression>

Where,

< TDL/TCP File Path Expression or GUID Expression > evaluates to the path of the TDL/TCP File or GUID of the TCP File to be checked, whether it is loaded or not.

Example

[Function : Display First TDL Report]

00 : If : $$IsTDLLoaded:@@TCPFileGUID

10 : Display : First TDL Report

20 : Unload TDL : @@TCPFileGUID

30 : End If

[System : Formula]

TCPFileGUID : “c2901088-349b-434b-946c-9ada601fd6b7”

In this example, if the TDL with GUID “c2901088-349b-434b-946c-9ada601fd6b7” is loaded, then the Report ‘First TDL Report’ will get displayed. Subsequently, the TDL is unloaded.

Function – $$HttpInfo

It is used to get the details of URL Host, ContentLength and Header information available during the receiving of the SOAP request. It accepts two parameters – ‘InfoType’ and ‘Info Sub Type’.

Function – $$ImportType

The Function $$ImportType is used to determine the type of Import, i.e., the source of data. The possible Import Types could be ‘Sync’, ‘Migration’, ‘Remote’, ‘NatLang’, ‘SOAP’ or ‘Manual’.

Function – $$ImportAction

This function is used to indicate the status of Import, i.e., whether the current Object was Created, Altered, etc. The possible results are ‘Created’, ‘Altered’, ‘Ignored’, ‘Combined’, and ‘Error’.

Function – $$LastImportError

The Function $$LastImportError can be used to extract the Import error description for the last object imported, which is helpful to retrieve after every import, and appropriate error logs can be maintained and displayed at the end of the Import Process. In case there is no Error while Importing the current Object, it would return the value as ‘Empty’.

Function – $$ImportInfo

The Function $$ImportInfo is useful to extract the details of the Imported Objects in terms of Number of Objects Created, Altered, Ignored, Combined, etc., and Errors encountered. This Function accepts a parameter ‘InfoType’.

Note: For details of the functions $$HttpInfo, $$ ImportType , $$ImportAction , $$LastImportError and $$ImportInfo , refer to the section ‘Data Importing Enhancements’.

Release 5.4.8

Function – IsAnyEmpty

When you want to check if there is an expression that evaluates to empty among a set of expressions, you can use the function IsAnyEmpty. This function evaluates the expression parameters in the sequence specified in the code. It will return True, the moment an expression evaluates to empty and ignores the subsequent expressions.

Syntax

$$IsAnyEmpty:<Expression1>:<Expression2>:…..:<ExpressionN>

Where,

Expressions can be variables, formulae, functions, etc.

Example

[Collection: TNOldAnnexIASummaryWithoutError]

Compute Var : HasError : Logical :$$IsAnyEmpty:##svRefNo:##svRefDate:##svLorryDate

Ensure that the sequence of parameters is such that higher the probability of an expression being Empty, earlier in the order they should be placed.

Previously, to evaluate more than one expression for empty, you had to use $$IsEmpty along with OR operator. Now, you can just use the new function to evaluate multiple expression in a single line.

Release 5.4.9

Function – ValidateTINMod97

You can use the function ValidateTINMod97 to check if the TIN provided is valid or not. It takes an input string which is the TIN and returns a logical value. It returns True if the input string is a valid TIN.

To check if the given string is a valid TIN, the function performs the following:

  1. Extract the digits from the alphanumeric string and check if there are exactly 11 digits.
  2. Rotate the number clockwise 4 times, perform MOD operation on the resulting number with 97, and check if the remainder is 1.

The TIN is not valid if any of the above checks fail.

Syntax

$$ValidateTINMod97:<Alphanumeric Value>

Where,

<Alphanumeric Value> is the TIN having alphabets as prefix/suffix.

Example

[Field: Mod 97]

Use : Name Field

Set as : 27240039198

Notify : IsValidTIN : Yes

[System: Formulae]

ValidateTin : $$ValidateTINMod97:$$Value

IsValidTIN : If @@ValidateTIN then “Valid” Else “NOT Valid”

Release 5.5.2

Function – SysInfo

The function SysInfo is enhanced to get the file name of the current application with the folder path.

Example

$$SysInfo:ModuleName

If the application path is C:\TallyPrime , it returns C:\TallyPrime\tally.exe .

 

Post a Comment