Explore Categories

 

 PDF

Collection Related Attributes

Aggr Compute

Aggr Compute attribute is used for aggregation purpose based on the criteria(s) specified with attribute By. Aggregation can be done to find Sum, Minimum or Maximum, or the Last value of the Method within the Grouped Method. The Method on which Aggregation has to be performed can be of Data Type ‘Number’, ‘Quantity’, ‘Rate’ or ‘Amount’.

Syntax

Aggr Compute : <Method-Name> : <Aggr-Type> : <Method-Formula>

Where,

< Method–Name > refers to the method where the result can be stored and referred to later.

< Aggr–Type > takes operation to be performed on the given method within the given criteria, i.e., Sum, Max, Min, or Last.

< Method–Formula > should be evaluated to method names on which Aggregation operation needs to be performed.

Example

[Collection: Vouchers Collection]

Type : Voucher

[Collection : Summary Collection]

Source Collection : Vouchers Collection

Walk         : Inventory Entries

By           : PartyLedgerName : $LedgerName

By           : StockItemName : $StockItemName

Aggr Compute : BilledQty : Sum : $BilledQty

BilledQty method retains the result of Aggregation, i.e., Summation of method BilledQty for a StockItem within a particular Party.

BelongsTo

The attribute Belongs To is used along with the ‘Child Of’ attribute. This attribute determines whether to retrieve the first level of objects under the value specified in ‘ChildOf’ or include all the objects upto the lowermost level. ‘Belongs To’ takes a logical value.

Syntax

BelongsTo : <Logical Value>

Where,

< Logical Value > can be either YES or NO .

Example

Consider the previous example of accounts. The following code is an extension of that code.’

[Collection : My Collection]

Type      : Ledger

ChildOf   : “Sundry Debtors”

BelongsTo : Yes

This code will retrieve all the objects directly under the group ‘Sundry Debtors’, as well as all the objects which are under the subgroups of ‘Sundry Debtors’.

By

Attribute By is mandatory and it allows to specify the criteria, based on which the aggregation is done. In other words, it works like GROUP – BY. Aggregation criteria can be one or more.

Syntax

By : <Method-Name> : <Method-Formula>

Example

[Collection : Vouchers Collection]

Type : Voucher

[Collection : Summary Collection]

Source Collection : Vouchers Collection

Walk : Inventory Entries

By   : PartyLedgerName : $LedgerName

By   : StockItemName : $StockItemName

In ‘Summary Collection’, Partywise Stock Items are clubbed, on which Aggregation, i.e., Sum/Min/ Max operations, would be performed.

Child Of

The ChildOf attribute helps to control the display of the contents of a collection. It retrieves only those objects whose direct parent is the string specified as the parameter of this attribute.

Syntax

ChildOf : <String Formula>

Example

[Collection : My Collection]

Type    : Ledger

ChildOf : “Sundry Debtors”

It will return all the ledgers grouped directly under the group ‘Sundry Debtors’. The following definition code will return all the ledgers under the group blank. By default, Tally returns the ledger ‘Profit and Loss’.

ChildOf : “”

Loop Collection

The data processing artefact of TDL, i.e., Collection, provides extensive capabilities to gather data from various data sources. The TDL application developers are aware that the source can be a report, parent report, collection/s and external data sources like Excel, XML, and so on.

It is possible to gather data from multiple collections in one collection. Till this enhancement, the collection didn’t directly support the capability to gather data dynamically from multiple collections based on the object context of another collection. The functionality was achieved using ‘Filter’ and ‘Child Of’ attributes of the ‘Collection’ definition. Programming using these was tedious and time-consuming and increased the code complexity as well, impacted the performance. The new enhancement has simplified the TDL code development.

The ‘Collection’ attribute of ‘Collection’ definition has been enhanced to repeat and combine the same collection based on the number and context of objects in another collection. The present syntax of ‘Collection’ attribute allows us to combine and collate the data from all the collections specified as a comma-separated list, provided the number, order and data type of methods are the same in each of the collection specified in the list.

Syntax

[Collection : <Collection Name>]

Collection : <List of Data Collection>[:<Loop Coll Name>[:+<Condition for Loop Coll]]

Where,

<Collection Name> is the name of the collection.

<List of Data Collection> is the comma-separated list of data collections.

<Loop Coll Name> is the name of the loop collection, and is optional.

<Condition for Loop Coll> is optional. The condition is evaluated on each object of the Loop Collection.

Compute

Apart from the ones used in By and Aggr Compute attributes, none of the other methods can be accessed unless they are declared explicitly. One of the ways of declaring the required methods is by listing them using the attribute Compute .

Syntax

Compute : <Method-Name> : <Method-Formula>

Example

Compute : Date : $Date

Method Date is being declared and made available for subsequent use.

Compute Var

The attribute Compute Var evaluates the value of the variable based on the sub-object of the source object.

Syntax

Compute Var : <Variable Name> : <Data Type> : <Formula>

Where,

<Variable Name> is the name of the variable.

<Data Type> is the data type of the variable.

<Formula> can be any expression formula which evaluates to a value of ‘Variable’ data type.

Example

Compute Var : IName:String : if ##LogVar then $StockItemName else ##LogVar

Example

When Compute Var is used in a simple collection, then before populating the objects in the collection, Compute var is evaluated. Consider the following Collection Definition:

[Collection : Test ComVar]

Type     : Group

Compute Var : CmpVarColl : String : $Name

Compute  : MyAmt : $$CollamtTotal:TestComVarSub:$OpeningBalance

[Collection : Test ComVar Sub]

Type     : Ledger

Child Of : ##CmpVarColl

Fetch    : Name, OpeningBalance

Data Source

The collection attribute Data Source is used to populate data to a collection dynamically from a variety of data sources. This attribute accepts the Type and Identity of the data source from where the data is to be retrieved. Directory, File XML, Name Set, and so on, are some of the data sources supported in TDL.

The collection attribute Data Source also support Rule Set, Num Set, and Flag Set as new data source types. This attribute helps the developer to gather the data pertaining to Rule Set, Num Set, or Flag Set like other data source types. The information of Num Set and Flag Set give same results except for the value. The value of Num Set is a number and value of Flag Set is logical. These data sources can be used for generating reports using Value and User Description methods. Otherwise, these can act as a debugging aid for the developer.

Syntax

Data Source : <Type> : <Identity> [:<Encoding>]

Where,

< Type> specifies the type of data source, e. g ., File XML, HTTP XML, Report, Parent Report, Rule Set , Num Set and Flag Set.

<Identity> can be the file path or the scope keywords or the name of the Rule Set/Num Set/Flag Set. If the type is File XML or HTTPXML,<identity> is the data source file path. If the type is Report or Parent Report then the scope keywords ‘Selected Lines’, ‘UnSelected Lines’, ‘Current Line’, ‘All Lines’, ‘Line’ and ‘Sorting Methods’ are used as the identity. Identity can also be an expression which results to the name of Num Set/Flag Set as specified in the corresponding data type

<Encoding> can be ASCII or UNICODE. It is Optional. The default value is UNICODE. If the da t a source type is Report or Parent report, the encoding format is ignored.

Data Source Types

Example: Xml as data source

Attribute Data Source allows to specify XML file as data source. The collection can be created directly from the specified XML file and the data in the XML file can be displayed in a report.

Syntax

DataSource : <Type> : <file path> : <Encoding>

Where,

< Type > specifies the type of data source – File Xml or HTTP XML

< File Path > is the data source file path.

< Encoding > is ASCII or UNICODE. It is Optional.The default value is UNICODE.

Example: 1

[Collection : My XML Coll]

DataSource : File Xml : “C:MyFile.xml”

In this code snippet, the type of file is ‘File XML’ as the data source is XML file. The encoding is UNICODE by default, as it is not specified.

Example: 2

[Collection : My XML Coll]

DataSource : HTTP Xml : “http:localhostMyFile.xml” : ASCII

In this code snippet, the type of file is ‘HTTP XML‘, as the data source is obtained through HTTP. The encoding of the file ‘MyFile.XML’ is ASCII.

Example: HTTP as data source

[Collection : My XML Coll]

Data Source : HTTP XML : “http:localhostMyFile.xml” : ASCII

In this code snippet, the type of file is ‘HTTP XML’, as the data source is obtained through HTTP. The encoding of the file ‘MyFile.XML’ is ASCII. While specifying the URL, now the https site can be given in Collection attributes Remote URL and Data Source.

Example: Report as data source

[Collection : My Report Coll]

Data Source : Report : Selected Lines

The selected objects from the current report in which the collection is accessed is the data source for the collection ‘MY Report Coll’.

Example: Parent Report as data source

[Collection : My Parent RepColl2]

Data Source : Parent Report : UnSelected Lines

The objects associated with all the unselected lines from the parent report are gathered for the collection ‘My Parent RepColl2’. The objects of the report with the given scope can be accessed from the report and functions which are called from the report.

Example: Flag Set as a Data Source

[Collection: DataSourceFSRepo]

Data Source: Flag Set: #FSDSVariable

The above code snippet helps to populate the collection DataSourceFSRepo with the data from the variable FSDSVariable, which returns a Flag Set name.

Data Source Type

Keyword

Parameters

Example

Rule Set

Rule Set

Name of the Rule Set definition

[Collection: DSRepo]

Data Source: Rule Set: DSRuleSet

Flag Set

Flag Set

An expression evaluating to the value of Flag Set data type

[Collection: DSRepo]

Data Source: Flag Set: $FlagSetValue

OR

Data Source:Flag Set: ##FlagSetValue

Num Set

Num Set

An expression evaluating to the value of Num Set data type

[Collection: DSRepo]

Data Source: Num Set: $NumSetValue OR

Data Source:Num Set:##NumSetValue

Fetch

Another way of declaring required methods is by listing them in Fetch attribute. The only difference here is that the method names of the Objects within this collection have to be referred by the same name as in the Object.

Syntax

Fetch : <Existing-Method-Name-in-Source> …

Where,

< Existing – Method Name in source > refers to the methods of the source collection.

Example

Fetch : Date, Narration

;;is equivalent to writing

Compute : Date : $Date

Compute : Narration : $Narration

Fetch using wildard characters

The two wild characters can be used in Fetch attribute * and ?.

  • * is used To fetch all the methods and collections of the current object in context.
  • ? is used To fetch all the methods of current object in context.

Example

  • To fetch all methods of current Object within Walk.

Fetch : ?

  • To fetch all methods and collection of current Object within Walk.

Fetch : *

  • To fetch the methods StockItemName, BilledQty, Amount and all the methods of collection Batch Allocation

Fetch : StockItemName, BilledQty, Amount, BatchAllocations.*

Filter

The attribute Filter is used to specify the condition for filtering the objects. The ‘Filter’ attribute takes a system formula. The condition is specified in the formula. If more than one filter has to be specified, they can be separated by a comma.

Syntax

Filter : <FilterName>

Where,

<Filter Name> is the name of the Global formula.

Example

[Collection : LtdDebtors]

Type    : Ledgers

ChildOf : “Sundry Debtors”

Filter  : NameFilter

[System : Formula]

NameFilter : $Name contains “Ltd” OR $Name contains “Limited”

The filter Namefilter is used to fetch only those objects, whose name contains the string “Ltd” or “Limited”.

Filter Var

The attribute Filter Var evaluates the value of the variable based on the objects available in the collection, after the evaluation of attributes Fetch and Compute.

Syntax

Filter Var : <Variable Name> : <Data Type> : <Formula>

Where,

<Variable Name> is the name of the variable.

<Data Type> is the data type of the variable.

<Formula> can be any expression formula which evaluates to a value of the ‘Variable’ data type.

Example

Filter Var : Fin Obj Var : Logical : $$Number:$BilledQty > 100

Keep Source

Keep Source

The attribute Keep Source is used to store the source data in main memory. The default value of this attribute is NO. When the Source Collection from which the Summary Collection is being prepared has a large number of objects and ‘Keep Source’ is set to YES, then the system goes out of memory since holding those objects in memory in one shot is not possible.

When Keep Source is set to No, the source objects are not retained in memory and they are processed as they are collected.

Syntax

Keep Source : Yes/No/…

Where,

Each dot specifies the parent one level up

. – Single dot retains the data of the source collection in current object.

.. – Double Dot retains the data of the Source Collection in current object’s parent.

– Triple Dot retains the data of Source Collection in current object’s parent’s parent, and so on.

Example

  • Keep the source collection in the current owner

Keep Source : Yes

OR

Keep Source : .

  • Don’t keep the source collection data

Keep Source : No

  • Keep the current source collections data in the current object’s parent

Keep Source : ..

  • Keep the current source collections data in current object’s grand parent

Keep Source :…

 Please note that using the current object as a source-collection means that ‘ Keep Source ’ is not applicable, as there is no actual source collection created.

Object

The attribute Object is used to create a collection of user-defined objects. A collection can have multiple collections/objects in it.

Syntax

Object : <List of Objects>

Where,

< List of Objects > is a comma-separated list of objects.

Here, the objects are defined using the Object definition, as shown in the following example.

Example

[Collection : Emp]

Object : Emp1, Emp2

[Object : Emp1]

EmpName : ” Ram Kumar”

Age     : “25”

[Object : Emp2]

EmpName : ” Krishna Yadav”

Age     : “30”

The Objects of Collection ‘Emp’ has the Methods ‘EmpName’ and ‘Age’.

Parm Var

The attribute Parm Var evaluates the value of the variable based on the requestor object’s context.

Syntax

Parm Var :<Variable Name>:<Data Type>:<Formula>

where,

<Variable Name> is the name of the variable

<Data Type> is the data type of the variable

<Formula> can be any expression which evaluates to the value of ‘Variable’ data type

Example

[Part: Groups and Ledgers]

Lines   : Groups and Ledgers
Repeat  : Groups and Ledgers : List of Groups
Scroll  : Vertical

[Line: Groups and Ledgers]

Fields       : GAL Particulars
Right Fields : GAL ClosBal
Explode      : List of Ledgers : ##ExplodeFlag

[Part: List of Ledgers]

Lines  : List of Ledgers
Repeat : List of Ledgers : Smp List of Ledgers

[Collection: Smp List of Ledgers]

Type     : Ledger
Child Of : $Name

In the collection Smp List of Ledgers, the Child Of attribute is evaluated based on the method $Name which is available from the Group Object in context. The line Groups and Ledgers (Requestor Object) is associated with a Group Object. 

In a Remote environment, when such a Report is being displayed at the Clients end, the request for the collection gathering goes to the Server End. At the server end, the Requestor Context is not available. So, the evaluation of $Name will fail. To overcome such a situation, the attribute called “Parm Var” has been used, which is a context-free structure available within the collection. It evaluates the expression based on the Requestors Context, thereby available at the Server Side also.

The Collection is redefined as follows using the attribute ParmVar

[Collection: Smp List of Ledgers]

Type     : Ledger
Child Of : ##ParmLedName
Parm Var : ParmLedName : String : $Name

The value of variable ParmLedName is evaluated at the Client side based on method $name available from Group Object Context, and sent to the Server. While gathering the objects at the server side, the attribute ‘ChildOf’ is evaluated, which uses the variable ParmLedName instead of $Name, available at the Server.

Prefetch and Source Prefetch

When a collection is being gathered, Fetch is used to fetch the methods at source and also bring them to the target object. In TDL, we also define multiple external methods at object level which can also be fetched using the Fetch attribute. This ensures that the resultant method is created at source and is also pulled into the target object. Any further access to these external methods using $ will provide the value directly, avoiding evaluation of method again.

However, there are scenarios, where Compute Var variables are used to evaluate expressions containing these external methods. Since Fetch is always evaluated after Compute Var, any access to external methods during Compute Var evaluation will end up evaluating again and again.

To solve this problem, an attribute Prefetch is introduced to declare the methods that are required to be fetched prior to Compute Var such that these Methods are available for usage within the current context thereby not requiring to re-evaluate the same expression each time they are used.

The sequence of methods declared in the Prefetch should be in the order of dependency, for instance, if Method 3 uses Method 2, and Method 2 uses Method 1, then, the declaration order in Prefetch should be Method 1, Method 2. A similar Source Prefetch is provided for the case of Source object context.

Syntax

PreFetch             : <Method1,…>

Source Prefetch: <Method 1,…>

Where,

<Expression> is the value that needs to evaluated.

Source Prefetch is applicable only when the walk is provided and Source Prefetch is evaluated before Source Var. Prefetch is evaluated before Compute Var but after Source Var.

Example

[Collection: LT_SummaryVchColl_With_PF]

Source Collection : LT_SimpleVchColl

Walk              : LedgerEntries

By   : LedgerName : $LedgerName

Aggr Compute      : Amount : Sum : $Amount

/* Two External Object Methods are pre-fetched so that these expressions get evaluated only once and used multiple times */

Prefetch          : LedgerParent, IsLedDebtorCreditor

Compute Var       : vIsCreditAllowed : Logical : If $$IsEmpty:$LedCreditPer then No else Yes

Compute: IsCreditAllowed : ##vIsCreditAllowed

[#Object: Ledger Entry]

LedgerParent        : $Parent:Ledger:$LedgerName

IsLedDebtorCreditor : $LedgerParent = $$GroupSundryDebtors OR

                      $LedgerParent = $$GroupSundryCreditors

IsPartyLedBillWiseOn: If $IsLedDebtorCreditor then $IsBillWiseOn:Ledger:$LedgerName else No

LedCreditPer        : If $IsLedDebtorCreditor and $IsPartyLedBillWiseOn then                   

                      $BillCreditPeriod:Ledger:$LedgerName else “”

[Collection: LT_SimpleVchColl]

Type : Voucher

As we can observe, that the Method LedgerParent is being prefetched, as a result of which, while evaluating the subsequent Method IsLedDebtorCreditor , the value of LedgerParent will be available and is not required to be re-evaluated. Similarly, since IsLedDebtorCreditor is prefetched, the subsequent methods IsPartyLedBillwiseOn and LedCreditPer using this method are also using the prefetched value, without re-evaluating.

Primary Status

It filters the transactions based on the (Primary) Status of Banking transactions stored in Link Master against each transaction. It accepts SysName as parameter, such as ‘Returned’, ‘Cancelled’, etc. It is applicable only for Collections of Type ‘Pay Link’ or ‘Party Pay Link’.

Syntax

[Collection : <Collection Name>]

Primary Status : $$SysName:<Status Parameter >

Where,

<Status Parameter> is the primary status of each transaction. It can be ‘StatusTransacted’, ‘Unstable’, ‘Cancelled’ and ‘Returned’.

Secondary Status

This attribute filters the transactions based on the additional status of each transaction type. It accepts SysName as Parameter, such as ‘Exported’, ‘Approved’, ‘Not Approved’, etc. This is applicable only for Collections of Type ‘Pay Link’.

Syntax

[Collection : <Collection Name>]

Secondary Status : $$SysName : <Status Parameter>

Where,

<Status Parameter> is the secondary status of each transaction. It can be ‘Exported’, ‘Approved’, ‘Not approved’ or ‘Primary’.

Example

[Collection : Pay Link Coll]

Type     : Pay Link

Child of : “ICICI”

Transaction Type : $$SysName:NEFT

Primary Status   : $$SysName:StatusTransacted

Secondary Status : $$SysName:NotApproved

Fetch    : *

Here, the Collection Pay Link Coll consists of Objects of Type Pay Link. The transaction type filters the collection of Type ‘Pay Links’ for transactions only of type NEFT, that are filtered with primary status as ‘Status Transacted’ and secondary status as ‘Not Approved’.

Search Key

This attribute is used to create index dynamically where the TDL programmer can define the key and the Collection is indexed in the memory using the Key. Once the index is created, any object in the collection can be instantly searched without needing a scan, as in the case of a filter. Search Key is Case Sensitive .

This attribute has to be used in conjunction with function $$CollectionFieldByKey . This function basically maps the Objects at the run time, with the Search Keys defined at the Collection.

Syntax

Attribute – Search Key

Search Key : <Combination of Method name/s>

Function – $$CollectionFieldByKey

$$CollectionFieldByKey : Method-Name : Key-Formula : CollectionName

Where,

< Method-Name > is the name of the method

< Key-Formula > is a formula that maps to the methods defined in the search key, exactly in the same order

Sort

A collection can be sorted by specifying the sort sequence using the Sort attribute. The collection can be sorted by a combination of fields in ascending as well as in descending order.

Syntax

Sort : < Sort Name> : <List of Methods>

Where,

< List Of Methods > is a comma separated list of methods. Sorting is done based on values of methods. The default sort order is ascending. Prefix Methods name with ‘-’, for descending order.

Example

[Collection : My Collection]

Collections    : MyLedger

Sort : Default : $ClosingBalance, $Name

Source Fetch

You can use the attribute Source Fetch to fetch methods from the source object context while in the current object context within Walk.

Syntax

Source Fetch: MethodSyntax, …

Where,

<MethodSyntax> is the method or collections to be fetched from the source object context.

Example

[Collection: TNAnnexureSummaryTemplate]

Source Collection : My Vouchers

Walk              : AllInventoryEntries

Source Fetch      : Date

By                : …

AggrCompute       : …

Attribute Source Fetch is not relevant in a Simple Collection or an Extract Collection without Walk and will be ignored.

If the source collection does not have Walk or WalkEx attributes, then Source Fetch will be ignored. Source Fetch will also be ignored if the source collection of is of type native collection.

Source Var

The attribute Source Var evaluates the value of the variable based on the source object.

Syntax

Source Var : <Variable Name> : <Data Type> : <Formula>

Where,

<Variable Name> is the name of the variable.

<Data Type> is the data type of the variable.

<Formula> can be any expression formula, which evaluates to a value of ‘Variable’ data type.

Example

Source Var : Log Var : Logical : No

The value of the variable LogVar is set to No.

Type

This attribute is used to define a collection of a particular Type or Subtype. This attribute can take values of the default TDL objects as well as the user-defined fields (UDF).

Syntax

Type : <ObjectType> [: <ParentType>]

Where,

< Object Type > is the name of the object type or its sub-type.

< Parent Type > is optional and is required if the subtype is to be specified.

Example

[Collection : My Collection]

Type : Ledger

The collection My Collection consists of a collection of Ledgers which is an Internal object.

Trigger 

When a table is displayed from a field, and a new value is to be added to the same table, the attribute Trigger is used. It invokes a report. For example, adding a new number in fields using dynamic tables such as Tracking number, Order No, etc.

Syntax

Trigger : <Report Name> : <Trigger Condition>

Where,

<Report Name> is the name of the report which is invoked if <Trigger Condition> is True. The value entered in the Output field of the <Report Name> is added to the table in the field.

Example

[Field : FieldTrigger]

Use        : Name Field

Table      : New Number, Not Applicable

Show Table : Always

Trigger    : New Number : $$IsSysNameEqual:NewNumber:$$EditData

CommonTable: No

Dynamic    : “”

In the field “FieldTrigger”, a report “New Report” is called when the option New Number is selected from the pop-up table. When the value has to be obtained from the complicated flow, a report name does not suffice. To support this functionality, a new attribute Trigger Ex is introduced. This attribute allows adding values to the dynamic table through an expression or user-defined functions.

Trigger Ex

The Trigger Ex attribute allows adding values to the dynamic table through an expression or user-defined function.

Syntax

TriggerEx : <Value-expression> : <Trigger Condition>

Where,

<Value Expression> is an expression/function which evaluates to a String if <Trigger Condition> is True. The string value thus obtained is added to the dynamic table.

Example

[Field : FieldTriggerEx]

Use         : Name Field

Table       : Ledger, New Number, Not Applicable

Show Table  : Always

TriggerEx   : $$FieldTriggerEx:$$IsSysNameEqual:NotApplicable:$$EditData

CommonTable : No Dynamic : “”

In the field, if the user selects any ledger from the table, the function $$FieldTriggerEx returns the parent, i.e., Group name of the ledger selected, and adds to the table “Ledger”.

[Function : FieldTriggerEx]

01 : RETURN : $Parent : Ledger : $$EditData

 Press Backspace in the report to view the additions to the table Ledger.

ReWalk and ReCompute

Many a time, there are requirements where objects being walked in a collection need to be walked once for certain computation followed by, ensuring that these computations are reflected back as methods in all the objects. The attributes ReWalk and ReCompute are introduced for this purpose. The objects are being walked in the first iteration with the values accumulated in some variable and if Rewalk is Yes , these objects are walked again so that the accumulated values are re-computed as methods along with objects

Syntax

ReWalk : <Logical Constant>

ReCompute : <MethodName> : <Expression>

Where,

< Logical Constant > is either Yes or No.

<MethodName> refers to the method where the result can be stored and referred to later.

Example

/* Regular voucher collection for source */

[Collection: My Vouchers]

Type : Vouchers

/* Main Aggregate collection uses By with Walk and ReWalk for totling item amount Query to execute: Select $Item, $TotalAmount, $ItemTotalAmount from MainAggrCollection*/

[Collection: Main Aggr Collection]

Source Collection : My Vouchers

Walk : Inventory Entries

;; Compute var for keeping total from first walk (NOTE: Need to reset this for every voucher)

Compute Var : WalkTotal : Amount: $$NettAmount:##WalkTotal:$Amount

;item name

By : Item : $StockItemName

;; itemwise total

Aggr Compute : TotalAmount : Sum: $Amount

; rewalk

Rewalk : Yes

;; must be same as total amount (but reflects for all entries)

ReCompute : ItemTotalAmount : ##WalkTotal

Transaction Type

This attribute filters the transactions based on the Link master Transaction type. It accepts SysName as parameter to identify the type of banking transaction, e.g ., ‘Cheque’, ‘Credit Card’, ‘Inter-Bank Transfers’, etc. It is applicable only for collections of Type ‘PayLink’/‘Party Pay Link’.

Syntax

[Collection: <Collection Name>]

Transaction Type: $$SysName:<Type Of Transaction>

Where,

<Type of transaction> is the link master transaction type used in banking. It can be Cash, Cheque, ATM, ECS, Cheque/DD, Interbank Transfer, Same Bank Transfer, Electronic Cheque and Electronic DD/PO.

Unique

The Unique attribute of Collection definition is used to control the display of unique values in the table for a specified method, based on values selected from the table previously in a field. The display of values is changed dynamically based on the field value.

Syntax

Unique : <Table Object Method> [,<Field Object Method>[,<Extended method>]]

Where,

<Table Object Method> is a method whose value is uniquely displayed in the table.

<Field Object Method> is the storage/method, which is associated with the field which is used to control the display of Table values dynamically. If a particular table object method value from the Table is selected in the field, then that value is removed from the table based on the value of <Field Object Method>. This parameter is mandatory if <Extended method> is specified, else it is optional.

<Extended Method> is a storage/method, whose value specifies whether the previous value of the field object method should be used to control unique values display in the table. If the current value of the value of <Extended Method> is same as that of previous values, then <Field Object Method> value is considered while populating unique values in the table. Otherwise, the <Field Object Method> value is ignored to set the unique values in the table. This parameter is optional.

The collection and definition is modified as follows, so that while populating unique values of Batch names in the table, StockItem name is also considered apart from the value of the field storage/method “BtName”, i.e., if the same stock item is selected in the field which has been selected previously, then the field storage/method value “BtName” is considered for controlling display of Batches, else it is ignored.

Example

[Collection : BatList]

Title    : “List of Batches”

Type     : Batch

Format   : $BatchName,20

Child of : #StkIt

Unique   : $BatchName, $BtName, $ItemName

Here, the method $Itemname used in the ‘Unique’ attribute is the storage defined in the field ‘StkIt’.

Walk

Attribute Walk allows specifying further elements to walk on the source. ‘Walk’ is optional and if not specified, the methods pertaining to the source object only, are available to be used. Walk can be specified to any depth for within the source object. This gives enormous flexibility and power. The Walk list has to be specified in the order in which they occur in the source object.

Syntax

Walk : <Sub-Object Type/Sub-Collection>[, <Sub-Object Type/ Sub-Collection> …]

Where,

< Sub–Object Type/Sub-Collection > is the name of the Sub-Object/ Sub Collection.

Example

[Collection: Vouchers Collection]

Type : Voucher

[Collection : Summary Collection]

Source Collection : Vouchers Collection

Walk : Inventory Entries

In the Summary Collection, by saying Walk : Inventory Entries, only methods within the ‘Inventory Entries’ Object are available to the current collection.

In case objects pertaining to Batch Allocations are required, the Walk can be written as:

Walk : Inventory Entries, Batch Allocations

wherein, all the methods within Batch Allocations will be available to the current collection.

WalkEx

Syntax

[Collection : <Collection Name>]

WalkEx : <Collection Name1>, <Collection Name2>,..

Where,

<Collection Name1>, <Collection Name2>, and so on, are the collection names specifying Walk and aggregation/computation attributes.

Example

The requirement here is to generate a Report displaying Item Wise and Ledger Wise amount totals for all Vouchers.

Walk Ex Attribute – Usage Implications

Let us consider the following code design, to understand the implication on various other collection attributes, in cases where ‘Walk Ex’ is used.

;; Source Collection

[Collection : SrcColl]

;;Resultant Collection “ResColl” is using the Source Collection “Src Coll”, and Walk Ex Collections “WalkEx Coll1 ”and “Walk Ex Coll 2” are specified

[Collection : ResColl]

Source Collection : Src Coll

WalkEx : Walk Ex Coll 1, Walk Ex Coll 2

;;Walk Ex Coll 1

[Collection : Walk Ex Coll 1]

Walk : Path1, SubPath1, SubSubPath1

By   : GroupName1 : $Method1

;;Walk Ex Coll 2

[Collection : Walk Ex Coll 2]

Walk : Path2, SubPath2, SubSubPath2

By   : GroupName2 : $Method2

The following table shows the attributes of ‘Collection’ definition and their applicability in the Resultant collection as well as WalkEx collections.

Attributes

Resultant Collection

Walk Ex-Collections

Source Collection

Specified and applicable

Ignored

Keep Source

Specified and applicable

No significance

Is Client Only

Specified and Considered

Ignored

Sorting

Specified and applicable

Ignored

Filtering

Specified and applicable

Ignored

Max

Specified and applicable

No significance

Parm Var

Specified and Considered

Ignored but to be inherited from the resultant collection

Source Var

Specified and Considered

Specified and applicable

ComputeFilter Var

Specified and applicable

Specified and applicable

Fetch

Specified and applicable

Specified and applicable

Compute

Specified and applicable

Specified and applicable

Aggr Compute

No significance

Specified and applicable

WalkBy

If Specified these two attributes WalkEx will be ignored

Specified and appli

Conditional WalkEx

The condition parameter of the Collection attribute, WalkEx is now enhanced to check for every Source Object.

Syntax

Walk Ex: <Collection> [:Condition]

Where,

<Condition> is an optional parameter. When provided, each source object will be evaluated based on the condition to decide if Walk Ex (of the specified collection) has to be executed.

 

Sequence of Evaluation of Collection Attributes

The collection attributes are evaluated as per the following sequence, before populating the collection:

  1. Source Collection
  2. Source Var
  3. Walk
  4. Compute Var
  5. By
  6. Aggr Compute
  7. Compute
  8. Filter Var
  9. Filter

With the introduction of these attributes, the calls to the functions $$Owner, $$ReqObject, $$FilterValue, $$FilterAmtTotal can be reduced.

TallyHelpwhatsAppbanner
Is this information useful?
YesNo
Helpful?
/* */