Explore Categories

 

 PDF

Objects and Collections Related Functions

LineObject

Since the Line Attribute Field can now be repeated over a Collection, wherein the Object context inherited from the Line is overridden in the Field; to switch back to the parent context, i.e., Line’s object context and extract the required method value, a New Function $$LineObject is used.

Syntax

$$LineObject : <String Formula>

Where,

<String Formula> can be any expression that gets evaluated in the Object context associated at the current field’s parent ‘Line’ in the Interface Object hierarchy.

NameGetValue

Function $$NameGetValue returns a string in the Name Set based on the values passed. The function $$NameGetValue takes two parameters, String identifier and Name Set Description Name .

Syntax

$$NameGetValue:<String Identifier>:<Name Set Description Name>

Where,

String Identifier > is the list name identifier.

Name Set Description Name > is the name of the Name Set.

Example

[Nameset : AnnexureErrorStrings]

List Name : E1 : “PAN Number Invalid”

List Name : E2 : “Lorry Number Missing”

List Name : E3 : “Commodity Code is Empty”

[Function NameSetTestFunction]

01 : LOG : $$NameGetValue:E2:AnnexureErrorStrings

;; This will print “Lorry Number Missing”

[Collection: My Collection]

Data Source : Name Set : AnnexureErrorStrings

The collection My Collection delivers 3 objects, as given below:

  • $Name: E1, $Value = “PAN Number Invalid”
  • $Name: E2, $Value = “Lorry Number Missing”
  • $Name: E3, $Value = “Commodity Code is Empty”

FlagGetValue

You can use the function $$FlagGetValue to get the value of a flag inside a Flag Set. It returns a logical value.

Syntax

$$FlagGetValue:<Rule Identifier>:<Flag Set Expression>

Where,

Rule Identifier > is a constant identifier or an expression that results in a rule identifier which is in dotted notation.

Flag Set Expression > evaluates to a Flag Set value.

Example

$$FlagGetValue:A1.B2:$MyFlagSet

For flag names, a dotted notation must be used to denote the fully qualified name of a flag. It shows the path of rule evaluation.

When “*” is passed as the Rule Identifier, it returns the master aggregate value (Zeroth flag value) of the Rule Set.

FlagSetOR

The function  $$FlagSetOR takes two flag sets as input and it performs the OR operation on them. It returns a Flag Set data type. Both flag sets must be obtained by evaluating the same rule set (potentially with different objects), otherwise, this function fails.

Syntax

$$FlagSetOR:<Flag Set 1>:<Flag Set 2>

Where,

< Flag Set 1 > is the first Flag Set expression.

<Flag Set 2> is the second Flag Set expression.

Example

$$FlagSetOR:$FlagSetA:$FlagSetB

FlagSetAND

The function $$FlagSetAND takes two Flag Sets as input and it performs AND operation. It returns Flag Set data type. Both flag sets must be obtained by evaluating the same rule set (potentially with different objects), otherwise this function fails.

Syntax

$$FlagSetAND:<Flag Set 1>:<Flag Set 2>

Where,

Flag Set 1 > is the first FlagSet expression.

Flag Set 2 > is the second FlagSet expression.

Example

$$FlagSetAND:$FlagSetA:$FlagSetB

FlagsIsAllTrue

The function $$FlagsIsAllTrue returns true if all child rules under the given rule are True (AND operator). It returns a logical type.

Syntax

$$FlagsIsAllTrue:<Parent Rule Identifier>:<Flag Set Expression> [:<Belongs To>]

Where,

<Parent Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. This is used as parent flag.

<Flag Set Expression> is the expression which results in a Flag Set on which this operation is to be performed.

<Belongs To> is the logical value to decide whether only immediate children or all children in the hierarchy of the given parent rule, to be considered. If this parameter is not specified, the default value is No.

Example

$$FlagsIsAllTrue:A1:$MyFlagSet:Yes

”*” can be passed as Rule Identifier to perform the operation from the root rule set level. If the parent rule does not have any child rules, then the function returns No .

FlagsIsAllTrueFromLevel

The function $$FlagsIsAllTrueFromLevel returns True, if all flags are True at a given level. It returns a logical value.

Syntax

$$FlagsIsAllTrueFromLevel:<Peer Rule Identifier>:<Flag Set Expression> [:<Leaf Rule Filter>]

Where,

<Peer Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is used to specify the level and the starting point of the aggregation/operation/walk.

<Flag Set Expression> is the expression which results in a Flag Set on which this operation is to be performed.

<Leaf Rule Filter> is the Rule Name to filter the non-qualified leaf flag. If specified, only rules ending with this Rule Name will be considered for the aggregation. If not specified, all rules at the specified level will be considered.

Example

$$FlagIsAllTrueFromLevel:A1.B1:$MyFlagSet:B1

In the above example, the rule B1 is the Leaf Rule Filter. A1.B1 denotes the second level and the starting point for aggregation. Since B1 is the Leaf Rule Filter, it considered A1.B1 and other rules which end with B1. The rules such as A1.B2 will not be considered.

*” is not applicable for this function.

It walks all flags in the same level as that of the Rule Identifier specified, starting from the given rule identifier. To consider all rules at a certain level, specify the identifier of the first rule in that level.

FlagsIsAnyTrue

The function $$FlagsIsAnyTrue returns True , if any child rule of a given flag is True (OR operator). It returns a logical value.

Syntax

$$FlagsIsAnyTrue:<Parent Rule Identifier>:<Flag Set Expression> [:<Belongs To>]

Where,

<Parent Rule Identifier > is a constant identifier or an expression that results in a rule identifier which is in dotted notation. This is used as parent flag.

Flag Set Expression > is the expression which results in a flag set on which this operation is to be performed.

<Belongs To> is the logical value to decide whether only immediate children, or all children in the hierarchy of the given parent rule, to be considered. If this parameter is not specified, the default value is No.

Example

$$FlagsIsAnyTrue:A1:$MyFlagSet:Yes

“*” is used to perform the operation from the root rule set level. If the parent rule does not have any child rules, then the function returns No .

FlagsIsAnyTrueFromLevel

The function $$FlagsIsAnyTrueFromLevel returns True, if any flags are True at a given level. It returns a logical value.

Syntax

$$FlagsIsAnyTrueFromLevel:<Peer Rule Identifier>:<Flag Set Expression>:<Leaf Rule Filter>

Where,

<Peer Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is used to specify the level and the starting point of the aggregation/operation/walk.

<Flag Set Expression> is the expression which results in a Flag Set on which this operation to be performed.

<Leaf Rule Filter> is the Rule Name to filter the non-qualified leaf flag. If specified, only rules ending with this Rule Name will be considered for the aggregation. If not specified, all rules at the specified level will be considered.

Example

$$FlagIsAnyTrueFromLevel:A1.B1:$MyFlagSet:B1

In the above example, the rule B1 is the Leaf Rule Filter. A1.B1 denotes the second level and the starting point for aggregation. Since B1 is the Leaf Rule Filter, it considered A1.B1 and other rules which end with B1 . The rules such as A1.B2 will not be considered.

“*” is not applicable for this function.

This function walks all flags in the same level as that of the Rule Identifier specified, starting from the given rule identifier. To consider all rules at a certain level, specify the identifier of the first rule in that level.

FlagsCount

You can use the function $$FlagsCount to get the number of flags under a given parent rule matching the value passed. It returns a number type.

Syntax

$$FlagsCount:<Parent Rule Identifier>:<Flag Set Expression>: [<Flag Value>:<Belongs To>]

<Parent Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. This is used as parent flag.

<Flag Set Expression> is the expression which results in a Flag Set on which the operation is to be performed.

<Flag Value> is a logical value. It can be either True/Yes or False/No. It is used to count flags that match this value. The default value is True/Yes .

<Belongs To> is the logical value to decide whether only immediate children, or all children in the hierarchy of the given parent rule, to be considered. If this parameter is not specified, the default value is No.

Example

$$FlagsCount:A1:$MyFlagSet:Yes:Yes

” *” is used to perform the operation from the root rule set level. If the parent rule does not have any child rules, then the function returns .

FlagsCountFromLevel

You can use the function $$FlagsCountFromLevel to get the number of flags at the same level, across parents, matching the flag value passed. It returns a number type.

Syntax

$$FlagsCountFromLevel:<Peer Rule Identifier>:<Flag Set Expression>: [<Flag Value>:<Leaf Rule Filter>]

Where,

<Peer Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is used to specify the level and the starting point of the aggregation/operation/walk.

<Flag Set Expression> is the expression which results in a flag set on which this operation is to be performed.

<Flag Value> is the logical value. It can be either True/Yes or False/No. It is used to count flags that match this value. The default value is True/Yes .

<Leaf Rule Filter> is the Rule Name to filter the non-qualified leaf flag. If specified, only rules ending with this Rule Name will be considered for the aggregation. If not specified, all rules at the specified level will be considered.

Example

$$FlagCountFromLevel:A1.B1:$MyFlagSet:Yes:B1

“*” is not applicable for this function.

If “?” is specified as the leaf rule filter, the leaf rules will be counted only once and duplicates will be ignored.

This function walks all the flags in the same level as that of the rule identifier specified, starting from the given rule identifier. To consider all rules at a certain level, specify the identifier of the first rule in that level.

FlagGetDescription

You can use the function $$FlagGetDescription to get a String description for the given Rule Identifier. It returns a string type.

Syntax

$$FlagGetDescription:<Rule Identifier>:<Flag Set Expression>

Rule Identifier > is a constant identifier or an expression that results in a rule identifier which is in dotted notation.

<Flag Set Expression> is the expression which results in a flag set. It is used to identify the Rule Set from which the rule description is to be obtained.

Example

$$FlagGetDescription:A1:$MyFlagSet

“*” is not applicable for this function.

It returns a description string associated with the rule identifier.

FlagsListDescription

You can use the function $$FlagsListDescription to get the list of string descriptions of all immediate child rules for the parent rule identifier passed, separated by the given character. It returns a string type.

Syntax

$$FlagsListDescription:<Parent Rule Identifier>:<Flag Set Expression>: [<Flag Value>:<Separator Character>]

Where,

<Parent Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is the parent rule name.

<Flag Set Expression> is the expression which results in a Flag Set on which the operation is to be performed. It is also used to identify the Rule Set from which the rule descriptions are to be obtained.

<Flag Value> is the logical value. It can be either True/Yes or False/No. It is used to get descriptions of flags that match this value. The default value is True/Yes .

<Separator Character> is a string value to separate string descriptions. If not specified, the default separator is used.

Example

$$FlagsListDescription:A1:$MyFlagSet:Yes:”,”

It considers all immediate child rules which match the flag value passed. ”*” can be passed as the parent rule identifier to get the descriptions from the rules in the first level.

FlagsListDescriptionFromLevel

You can use the function $$FlagsListDescriptionFromLevel to get a list of unique string descriptions for the set of rules/flags from a given level, across parents that match the flag value passed. It returns a string type.

Syntax

$$FlagsListDescriptionFromLevel:<Peer Rule Identifier>:<Flag Set Expression>:[<Flag Value>:<Separator Character>]

Where,

<Peer Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation. It is used to specify the level and the starting point of the aggregation/operation/walk.

<Flag Set Expression> is the expression which results in a Flag Set on which the operation is to be performed. It is also used to identify the Rule Set from which the rule descriptions are to be obtained.

<Flag Value> is the logical value. It can be either True/Yes or False/No. It is used to get descriptions of flags that match this value. The default value is True/Yes .

<Separator Character> is a string value to separate string descriptions. If not specified, the default separator is used.

Example

$$FlagsGetDescriptionListFromLevel:A1.B1:$MyFlagSet:Yes:”,”

In the above example, all descriptions at the level of rule A1.B1 and starting from the rule A1.B1 will be considered. However, a description will be considered only once. Rule A1.B1 and A2.B1 will refer to the same description, (i.e., description of Rule B1, assuming in both cases B1 is referring to same rule) but the description will be taken only once.

 AsFlagSet

You can use the function $$AsFlagSet to convert a NumSet to a FlagSet which allows the use of all FlagSet functions. It creates an equivalent FlagSet considering all non-zero numbers as True, and zero numbers as False.

Syntax

$$AsFlagSet:<Num Set Expression>

Where,

<NumSet Expression> is the expression evaluates to a NumSet value.

Example

$$AsFlagSet:$MyNumSet

This conversion leads to a loss of count information in the resultant flag set. True value in the flag set only represents a non-zero value in the original NumSet. However, the exact value cannot be obtained.

NumGetValue

Use the function $$NumGetValue to get a value inside a NumSet. It returns a number type.

Syntax

$$NumGetValue:<Rule Identifier>:<NumSet Expression>

Where,

<Rule Identifier> is a constant identifier or an expression that results in a rule identifier which is in dotted notation.

<Num Set Expression> is the expression that evaluates to a Num Set from which the number is to be fetched.

Example

$$NumGetValue:A1.B2:$MyNumSet

”*” helps to extract the master aggregate value (Zeroth num value) of the rule set.

AsNumSet

You can use the function $$AsNumSet to convert a Flag Set to a Num Set.

Syntax

$$AsNumSet:<Flag Set Expression>

Where,

<Flag Set Expression> is any expression of Flag Set data type.

Example

$$AsNumSet:$MyFlagSet

It creates an equivalent NumSet by considering all False values as zero, and True as one. The NumSet generated by this function will contain only 0s and 1s.

AccessObj

The capability to access data objects associated with Interface objects are used in TallyPrime. 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.

The function $$AccessObj is used 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.

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.

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.

FilterAmtTotal

It is used to get the sum of values returned by the specified filter expression when applied to all the Objects in the Collection that satisfy the expression. The value returned is of type Amount.

Syntax

$$FilterAmtTotal:<CollectionName>:<FilterExpression>:<ValueExpression>

Where,

< CollectionName > is the name of a Collection,

< FilterExpression > is a System Formula.

< FilterExpression > is evaluated for each Object. The resultant Objects that clear the filter are selected for further processing.

< ValueExpression > is any valid expression, which is to be evaluated on each Object of the Collection.

Example

$$FilterAmtTotal:AllLedgerEntries:CashBankEntries:$Amount

[System : Formula]

CashBankEntries : $$IsCashLedger:$LedgerName AND $$IsDr:$Amount

The filter in the example checks whether the ledger is a Cash Ledger and the amount is of the type ‘Debit’. $$IsCashLedger is a logical function, which checks whether the argument passed is a Cash Ledger or not. This statement can be evaluated only in the context of a Voucher Object.

FilterQtyTotal

It is similar to $$FilterAmtTotal, except that the Value Expression should evaluate to type Quantity.

Syntax

$$FilterQtyTotal:<CollectionName>:<FilterExpression>:<ValueExpression>

Where,

< CollectionName > is the name of Collection

< FilterExpression > is a System Formula.The Filter Expression is evaluated for each object, and the resultant Objects that clear the filter are selected for further processing.

< ValueExpression > is any valid expression, which is to be evaluated on each Object of the Collection.

FilterCount

The function $$FilterCount is used to get the total number of Objects in a Collection after the filters are applied.

Syntax

$$FilterCount : <CollectionName> : <FilterExpression>

Where,

< CollectionName > is the name of a Collection.

< FilterExpression > is a System Formula.

Example

$$FilterCount:AllLedgerEntries:HasBankEntry > 0

[System : Formula]

HasBankEntry :($$IsDr:$Amount!=$IsDeemedPositive:VoucherType:$VoucherTypeName)+

AND($$IsLedOfGrp:$LedgerName:$$GroupBank OR $$IsLedOfGrp:$LedgerName:$$GroupBankOD)

It confirms whether the voucher has any Ledger under the Group Bank or BankOD.

Note : The function $$FilterCount will not work at the menu level.

$$IsLedOfGrp accepts two parameters and returns TRUE if parameter 1 is a ledger of a Group mentioned in parameter 2. GroupBankOD and GroupBank are functions that return the name of the reserved groups Bank OD and Bank.

FilterValue

This function is used to get the value of a specific expression, based on the position specified in the set of objects filtered by the expression.

Syntax

$$FilterValue : <ValueExpression> : <CollectionName> : <PositionSpecifier> : <FilterExpression>

Where,

< CollectionName > is the name of the Collection.

< FilterExpression > is the filter applied to get a set of filtered Objects.

< PositionSpecifier > denotes the position.

< ValueExpression > is any valid expression to be evaluated on each Object of the Collection.

Example

$$FilterValue:$LedgerName:LedgerEntries:First:IsPartyLedger

This example filters all the objects within LedgerEntries to satisfy the filter condition IsPartyLedger and returns the first value of the requested method LedgerName that satisfies the condition.

GroupSundryDebtors

It returns the name of the group Sundry Debtor, even if the user renames it.

Syntax

$$GroupSundryDebtors

Example

[Collection : Sample Coll]

Type     : Ledgers

Child Of : $$GroupSundryDebtors

This will populate the collection Sample Coll with all objects under the Group ‘Sundry Debtors’. In case the user has renamed the group “Sundry Debtors” as “My Sundry Debtors”, the following code snippet won’t have any objects in the collection.

[Collection : Sample Coll1]

Type     : Ledgers

Child Of : “Sundry Debtors”

But in this case, $$GroupSundryDebtors will populate the collection with all the objects that are under the Group ‘Sundry Debtor’ even if the user renames the group.

GroupSundryCreditors

It returns the name of the group Sundry Creditors, even if the user renames it.

Syntax

$$GroupSundryCreditors

Example

[Collection : Sample Coll]

Type     : Ledgers

Child Of : $$GroupSundryCreditors

This will populate the collection Sample Coll with all objects under the Group ‘Sundry Creditors’. In case the user has renamed the group “Sundry Debtor” as “My Sundry Debtors”, the following code snippet won’t have any objects in the collection.

[Collection : Sample Coll1]

Type     : Ledgers

Child Of : “Sundry Creditors”

But in this case, $$GroupSundryCreditors will populate the collection with all the objects that are under the Group “Sundry Creditors”, even if the user renames the group.

CollectionFieldByKey

This function enables the TDL Programmer to create *in-memory indexed collections* based on some Search Key. This indexed collection will have significant performance improvement.

Syntax

$$CollectionFieldByKey : <Method Name> : <Key Formula> : <Collection Name>

Where,

< Method Name > is the name of the method.

< Key Formula > is a formula that can be mapped to the methods defined in the search key exactly in the same order.

Example

[Collection: My Ledgers]

Type       : Ledger

Search Key : $Name

[Field : My Closing Bal Field]

Set as      : $$CollectionFieldByKey:$ClosingBalance:@MySearchKey:My Ledgers

MySearchKey : #LedName

Here, a search key is defined on $ name for collection MyLedgers . In the Field, value $Closing Balance is retrieved based on ledger name. In this case, retrieval is faster than ordinary retrieval.

This capability is quite useful in the case of matrix reports, i.e., when two or more dimensions need to be represented as rows and columns. In such a case, defining the search key on a method combination, and using $$ CollectionFieldByKey for value retrieval improves performance. 

Note : The function $$CollectionFieldByKey will not work at menu level

CollectionField

This is used to get the value of a specified expression as applied on the nth Object of a Collection.

Syntax

$$CollectionField:<ValueExpression>:<PositionNumber>:<CollectionName>

Where,

< CollectionName > is the name of a collection.

< ValueExpression > is any valid expression to be evaluated on the element at position < PositionNumber > in the collection.

Example

$$CollectionField:$Amount:1:AllLedgerEntries

It returns the first value of the Method Amount from AllLedgerEntries Object. This function affects the performance of the report in terms of time taken to display the report. 

Note: The function $$CollectionField will not work at menu level

CollAmtTotal

This function is used to get the sum of values of Type Amount returned by a specified expression when applied to all Objects in a given Collection. The return value is of type Amount.

Syntax

$$CollAmtTotal : <CollectionName> : <ValueExpression>

Where,

< CollectionName > is the name of a Collection.

< ValueExpression > is any valid TDL expression to be evaluated on each Object of Collection.

Example

$$CollAmtTotal:LedgerEntries:$Amount

It gets the sum of values in the method Amount after it is applied on each Object in the Collection LedgerEntries. This statement will hold good only when one is in the context of Voucher Object.

CollQtyTotal

This function is used to get the sum of values of Type Quantity returned by the specified expression when applied to all Objects in a given Collection. The value returned is of Type Quantity.

Syntax

$$CollQtyTotal : <CollectionName> : <ValueExpression>

Where,

< CollectionName > is the name of a Collection

< ValueExpression > is any valid TDL expression to be evaluated on each Object of Collection.

Example

$$CollQtyTotal:InventoryEntries:$BilledQty

Each Inventory entry in the current Voucher Object is picked up and the method BilledQty is evaluated on it. The resultant quantity is summed up to get the result.

CollNumTotal

This function is used to get the sum of values of type Number returned by the specified expression, when applied to all Objects in a given Collection. The value returned is of the type Number .

Syntax

$$CollNumTotal : <CollectionName> : <ValueExpression>

Where,

< CollectionName > is the name of a Collection.

< ValueExpression > is any valid expression to be evaluated on each Object of the Collection.

Example

$$CollNumTotal:InventoryEntries:$Height

Each Inventory entry in the current Voucher Object is picked up and the Method Height evaluated on it. The resultant height is summed up to get the result. Here, Height is an external Method of Object Inventory Entry in a Voucher.

LoopCollObj

The function $$LoopCollObj is used to refer to any method of the Loop Collection objects in the Data Collection. The Data Collection can use this function for the evaluation of expressions.

Syntax

$$LoopCollObj : <Method name from Loop Coll Obj>

Where,

<Method name from Loop Coll Obj> is name of method from the object of the loop collection.

Example

A collection is created to gather all the vouchers of all the loaded companies as follows:

[Collection : Vouchers of Multiple Companies]

Collection : VchCollection : Company Collection

Sort : Default : $Date, $LedgerName

Objects in collection ‘Vouchers of Multiple Companies’ are sorted based on date and ledger name

[Collection : VchCollection]

Type    : Voucher

Fetch   : Date, Vouchernumber, VoucherTypeName, Amount, MasterID , LedgerName

Compute : OwnerCompany : $$LoopCollObj:$Name

Let us examine the Data Collection definition “VchCollection”. When the attribute ‘Compute’ is evaluated, the Loop collection object context is not available here. So, to refer to the Company Name, the function $$LoopCollObj is mandatory.

[Collection : Company Collection]

Type : Company

Fetch : Name

TableNumItems

A new function $$TableNumItems  returns the number of items in the list or table.

Example

[Collection : RTS Ledger]

Type         : Ledger

Format       : $Name

Format       : $Parent

Format       : $ClosingBalance

[Field : Reducing Table Search GT 100]

Use          : Name Field

Table        : RTSLedger

Show Table   : Always

Table Search : $$TableNumItems > 100 : Yes

In this example, the field ‘Reducing Table Search GT 100’ is displaying the table ‘RTS Ledger’, which has three columns’ Name’,’ Parent’, and ‘Closing Balance’. The attribute ‘Table Search’ evaluates the first value to YES, only when the number of items in the table exceeds 100, i.e., reducing search is enabled if the specified condition is satisfied. The second attribute value is set to YES, i.e., the search criteria will apply to all columns in the table.

Owner

The function $$Owner evaluates the given expression in the context of the parent data object in the Data Object hierarchy chain, i.e., it will change the Data Object context to the parent of the current Data Object in context. For example, if the current object context is Batch Allocations, then to access the value from Inventory Entries, which is its parent data object, the $$Owner function can be used.

Syntax

$$Owner : <Expression>

Example: 1

In this example, let us assume that the “Bill Allocations Amount” field (Requestor) exists in context of Bill Allocations Data Object. In order to evaluate the method “Amount” from Ledger Entries Object Context, we need to use the function $$Owner.

[Field : Bill Allocations Amount]

Set As : $$Owner:$Amount

In this field, method Amount from parent object LedgerEntries is set by using $$Owner function.

Example: 2

Similarly, let’s assume that the current data object context for the field “ Bill Allocations Remarks ” is Bill Allocations , and we need to evaluate the method Narration from Voucher Object.

[Field : Bill Allocations Remarks]

Set As : $$Owner:$$Owner:$Narration

In this field, Narration from object Voucher, which is 2 levels above in hierarchy, is set using $$Owner twice. In other words, we are requesting for method Narration from the owner of owner. Alternatively, in these examples, we can use the dotted method formula syntax.

[Field : Bill Allocations Amount]

Set As : $..Amount

[Field : Bill Allocations Remarks]

Set As : $…Narration

In these examples, .. denotes the parent and … denotes the Grand Parent.

BaseOwner

Function $$BaseOwner evaluates the given expression in the context of the base/primary data object in the Data Object hierarchy chain available with the ‘Report’ Object (in memory).

Note: Since the entire Data Object hierarchy is cached with the Object associated at the Report, the function $$BaseOwner changes the Data Object context to the Object associated at the Report.

For example, if the current data object context is Batch Allocations, then to access the method value from Voucher$$BaseOwner function can be used.

Syntax

$$BaseOwner : <Expression>

Example

As per the Voucher hierarchy, let’s assume that our current data object context for the field “Bill Allocations Remarks” is Bill Allocations. In order to access the value of Method Narration from Voucher Object, which is the base/primary object in the object hierarchy chain, we can use the function $$BaseOwner.

[Field : Bill Allocations Remarks]

Set As : $$BaseOwner:$Narration

In this field, the Method Narration from the base Object Voucher is set, using $$BaseOwner. Alternatively, in the above example, we can use the dotted method syntax.

[Field : Bill Allocations Remarks]

Set As : $().Narration

In this example, (). navigates to the Primary/Base Data Object

PrevObj

Function $$PrevObj evaluates the given expression in the context of the previous data object of the collection, which contains the current data object in context.

Syntax

$$PrevObj : <Expression>

Example

Assume that a line is being repeated over a collection of Outstanding Bills, which is sorted based on PartyName. After every Party Info, a Total Line is needed to print subtotal for current Party.

[Line : Outstanding Bills]

Option : Partywise Totals : $$PrevObj:$PartyName!= $PartyName

[!Line : Partywise Totals]

Add : Lines : At Beginning : Party SubTotal Line

In this example, an optional line will be included only if the method PartyName of the previous object is not equal to that of the current object.

NextObj

Function $$NextObj evaluates the given expression in the context of the next data object of the collection, which contains the current data object in context.

Syntax

$$NextObj : <Expression>

Example

Assume that a line is being repeated over a collection of Outstanding Bills, which is sorted based on PartyName. After every party Info, a Total Line is needed to print the subtotal for current Party.

[Line : Outstanding Bills]

Explode : Partywise Totals : $$NextObj:$PartyName!= $PartyName

In this example, a part is exploded, provided the method PartyName of the next object is different from that of the current object. This will enable explosion for each party only once, and thereby, we can easily achieve the subtotal line as desired.

FirstObj

Function $$FirstObj evaluates the given expression in the context of the first data object of the collection, which contains the current data object in context.

Syntax

$$FirstObj : <Expression>

Example

Assume that a line is being repeated over the ledger collection, wherein a field, we require the first object’s name to be set.

[Field : First Name]

Set As : $$FirstObj:$Name

In this example , a Field First Name is set as the Name Method of the first object in the Collection.

LastObj

Function $$LastObj evaluates the given expression in the context of the last data object of the collection, which contains the current data object in context.

Syntax

$$LastObj : <Expression>

Example

Assume that a line is being repeated over the ledger collection, where in a field, we require the last object’s name to be set.

[Field : Last Name]

Set As : $$LastObj:$Name

In this example , a Field Last Name is set as Name Method of the last object in the Collection.

LoopCollObj

As we are aware, it is now possible to gather Data Collection in context of each object of another collection, which is referred to as a Loop Collection. To access the methods of Loop Collection Objects from within the Data Collection, $$LoopCollObj is used, with which the expression is evaluated in the context of the Loop Collection Objects.

Syntax

$$LoopCollObj : <Expression>

Example

To see a consolidated list of vouchers across all the loaded companies.

[Collection : Company Collection]

Type  : Company

Fetch : Name

[Collection : Vouchers of Multiple Companies]

Collection : MultiCmpDB VchCollection : Company Collection

Sort       : Default : $Date, $LedgerName

[Collection : MultiCmpDB VchCollection]

Type    : Voucher

Fetch   : Date, Vouchernumber, VoucherTypeName, Amount, MasterID, LedgerName

Compute : Owner Company : $$LoopCollObj:$Name

In this example, the function $$ LoopCollObj changes the context to Loop Collection Objects, which is the Company Collection and hence, returns the company name.

ReportObject

The function $$ReportObject evaluates the given expression in the context of the Data Object associated with the Report Interface Object.

One of the important Use Cases of $$ReportObject is its usage in purview of in-memory Collection gathering. Whenever a collection is gathered, it is retained in memory with the Data Object of the current Interface (Requestor) Object. If the same collection is being used in expressions again and again, then it is beneficial from the performance point of view to attach it to the ‘Report’ Object and evaluate it in the context of ‘Report’ Object n number of times. This eliminates the need to re- gather the collection every time in context of other Data Objects.

Syntax

$$ReportObject : <Expression>

Example: 1

From Bill Allocations Data Object context, Voucher No. of Report Object Voucher is required.

[Field : Bill No]

Set As : $$ReportObject:$VoucherNumber

Example: 2

In a Report, Sales of each Item against the corresponding Parties is required.

[Collection : CFBK Voucher]

Type   : Voucher

Filter : IsSalesVT

[Collection : CFBK Summ Voucher]

Source Collection : CFBK Voucher

Walk              : Inventory Entries

By : PName : $PartyLedgerName

By : IName : $StockItemName

Aggr Compute : BilledQty : SUM : $BilledQty

Search Key   : $PName + $IName

[Field : CFBK Rep Party]

Use       : Qty Primary Field

Set as    : $$ReportObject:$$CollectionFieldByKey:$BilledQty:@MyFormula:CFBKSummVoucher

MyFormula : ##PName + #CFBKRepName

Here, the function $$ReportObject, during its first execution, retains the collection within the Voucher Object (which is the Data Object associated with the ‘Report’ Object). During subsequent calls, method values are fetched from the Objects available in the ‘Report’ Data Object, instead the entire Collection being regathered again. This helps in improving the performance drastically.

ReqObject

This function evaluates the given expression in context of the Data Object associated with the Interface (Requestor) Object. There may be scenarios where during expression evaluation, Data Object context changes automatically and all the methods referred to are evaluated in context of the changed Data Object. The Data Object associated with the Interface (Requestor) Object is lost. Specifically in those cases, where we need to evaluate methods in context of the data object associated with the Interface (Requestor) Object, we will use the function $$ ReqObject .

Syntax

$$ReqObject : <Expression>

Example

A Report is required to display Ledgerwise Sales Totals

[Field : Fld LedSalesTotal]

Set As : $LedgerSalesTotal

[#Collection : Ledger]

Compute : LedgerSalesTotal : $$FilterAmtTotal:LedVouchrs:MyParty:$Amount

[Collection : Led Vouchers]

Type       : Voucher

Filter     : OnlySales

[System : Formula]

My Party   : $PartyLedgerName = $$ReqObject : $Name

Only Sales : $$IsSales:$VoucherTypeName

In this example, a new method LedgerSalesTotal is added in the Ledger Object to compute the Sales Total from all the Vouchers filtered for the current Party Ledger Object. The Interface Object (Requestor) for this method is the field “FldLedSalesTotal”. In the Formula My Party, current Ledger Name must be checked with the Party Ledger Name of the Voucher Object, which is the current Data Object context. The Data Object associated with the Requestor is Ledger Object. So, in order to evaluate the method $name from the Interface (Requestor) Object’s Data Object context, the function $$ Reqobject must be used.

ObjectOf

As we are already aware, there is the capability to identify a Part and Line Interface Object using a unique Access Name. A Form/Report can be identified from any level using the Definition Type. The function $$ObjectOf is used to evaluate the expression in context of the Data Object associated with the Interface Object identified by the Access Name.

The Interface Object being referred to, should be assigned a unique AccessName via Access Name attribute.

Syntax

$$ObjectOf : <DefinitionType> : <AccessNameFormula> : <Evaluation Formula>

Example

[Part : Cust Object Association]

Lines : Cust Object Association

;; Object associated at Part

Object Ex : (Ledger, “Customer”).

;; Access Name specified so that this part can be accessible

Access Name : “CustLedger”

;; In some other fields across parts, we can access the methods of the Ledger Object associated with the part “CustObjectAssocia- tion”, using the function $$ObjectOf

[Field : Ledger Parent]

Set as : $$ObjectOf:Part:”CustLedger”:$Parent

The Part “ Cust Object Association ” is associated with the Ledger Object “Customer”. It is identified by the Access Name “CustLedger”. The Field Ledger Parent from a different Part accesses the method $Parent from the Ledger object ‘Customer’, as it is the Object associated with the part Cust Object Association, identified by Access Name “CustLedger”.

Table

It evaluates the expression in the context of Table object, which is selected in the given Field.

Syntax

$$Table : <Field Name> : <expression>

Example

[Field : Vehicle Number]

Table      : List of Vehicles

Show Table : Always

[Field : Vehicle Type]

Set as  : $$Table:VehicleNumber:$VehType

[Field : Vehicle YOP]

Set as  : $$Table:VehicleNumber:$VehYOP

[Collection : List of Vehicles]

Type    : Veh AggUDF : Company

ChildOf : ##SVCurrentCompany

Format  : $VehNo, 20

Format  : $VehType, 40

Format  : $VehYOP, 4

Fetch   : VehNo, VehType, VehYOP

;; For Remote Client End

In this code, the table is displayed in the field “Vehicle Number”. In the other fields ‘Vehicle Type’ and ‘Vehicle YOP’, $$Table is used to evaluate the methods $VehType and $VehYOP in context of the Data Object selected in the field “Vehicle Number”.

TableObj

$$TableObj is similar to the function $$Table. The expression is evaluated in context of the Data Object selected in the Table in the field specified. The difference of this function from the function $$Table is that, in case no object is selected in the Table, or expression evaluation fails, $$Table returns a blank string. In such a case, $$TableObj returns a logical value (FALSE) as the result.

Syntax

$$TableObj : <Field Name> : <expression>

Example:

A field needs to be skipped based on the selection of the table in a field.

[!Field : VBOrdDueDRNote]

Skip : $$TableObj:VCHBATCHOrder:$$IsOrder

In this example, if the Object selected in the Field VchBatchOrder is an Object Order, then the current field needs to be skipped.

$$AsReqObj

The function $$AsReqObj is used to save the Interface (Requestor) context to the current object, for the evaluation of the expression. All the future references have done using $$ReqObject will point to the saved Interface Object context. The actual requestor is overridden using the function $$AsReqObject .

Syntax

$$AsReqObj : <Expression>

Example

Here, a Table of Company Vehicles is displayed in a Field “Select Vehicle”, which exists in the context of the Voucher Object. The table is filtered on the basis of Unused Vehicles.

[Field : Select Vehicle]

;; In Voucher Entry

Table   : CMP Vehicles

Storage : VCHVehicle

[Collection : CMP Vehicles]

Type    : Company Vehicles : Company

Childof : ##SVCurrentCompany

Format  : $VehicleNumber, 20

Format  : $VBrand, 10

Title   : “Company Vehicles”

Filter  : Unused Veh

[System : Formula]

Unused Veh   : $$AsReqObj:$$FilterCount:PrevSalesVchs:UsedVehicle = 0

Used Vehicle : $$ReqObject:$VehicleNumber=$VCHVehicle

Only Sales   : $$IsSales:$VoucherTypeName

[Collection : PrevSalesVchs]

Type   : Voucher

Filter : Only Sales

In this example :

  • Field Select Vehicle is the Interface (requestor) object, associated with the data object Voucher.
  • Table/Collection of Company Vehicles is displayed in the Field.
  • Table is filtered for Unused vehicles.
  • This collection contains the list of Vehicle Numbers which need to be compared with the ones used in the previous sales vouchers. Since Requestor is the Field with the data object ‘Voucher’, Function $$ReqObject will get evaluated in the context of ‘Voucher’ Object, which is not expected. Hence to make the current collection, i.e., CMP Vehicles, as requestor object for future reference, Function $$AsReqObj is used.
  • In the Function $$FilterCount, when the object context changes to the list of sales vouchers, the Function $$ReqObject evaluates the parameter $VehicleNumber in the context of the requestor Collection CMP Vehicles set earlier using $$AsReqObj, and compares the same with the Voucher UDF VchVehicle stored in the respective vouchers.

 

ReqOwner

The Function $$ReqOwner evaluates the given expression in the context of the Interface (Requestor) object’s Owner in the current Interface object hierarchy. For instance, Report is an owner requestor for Form, Form is an owner requestor for Part, and so on. From the Line, when the function $$ReqOwner is used, the expression gets evaluated in the context of the Part containing the current line.

Syntax

$$ReqOwner : <Expression>

Example

[#Menu : Gateway of Tally]

Add : Key Item : ReqOwner Sample : W : Alter : ICCF ReqOwner

[Report : ICCF ReqOwner]

Form     : ICCF ReqOwner

Variable : VarReqOwner : String : “Keshava”

[Form : ICCF ReqOwner]

Parts : ICCF ReqOwner

[Part : ICCF ReqOwner]

Lines : ICCF ReqOwner

[Line : ICCF ReqOwner]

Fields : ICCF ReqOwner

[Field : ICCF ReqOwner]

Set As     : $$FuncToReturnReqOwner

Set Always : Yes

[Function : FuncToReturnReqOwner]

Variable : VarReqOwner : String : “Madhava”

Variable : Temp : String : $$ReqOwner:##VarReqOwner

01 : MSGBOX : ##VarReqOwner : ##Temp

10 : RETURN : $$ReqOwner:##VarReqOwner

In this example, the Variable VarReqOwner is declared & initialized in a Report as well as in a function. From the Field, the function $$ReqOwnerFunc is referred to perform some computation and return the result. Since $$ReqOwner is used in the Function and Field is the Requestor Owner for Function, the Field walks back the Interface (Requestor) Object hierarchy to fetch the Variable value. Hence, the Variable value Keshava of the nearest Interface Object, i.e., of the Report is returned.

 

AccessObj

As we are already aware, there is the capability to identify a Part and Line Interface Object using a unique Access Name. The function $$AccessObj changes the Interface Object context to the one identified by the Access name to evaluate the expression

The Interface Object being referred to should be assigned a unique Access Name via Access Name attribute.

Syntax

$$AccessObj : <DefinitionType> : <AccessNameFormula> : <Evaluation Formula>

Example

[Line : ABC]

Access Name : “AccABC”

[Field : XYZ]

Set As : $$AccessObj:Line:“AccABC”:##VarABC

In this example, the function $$AccessObj changes the Interface Object context from the field “XYZ” to the line “ABC”, which is identified by the Access Name “AccABC”. The variable value is evaluated in context of the line “ABC”.

Post a Comment

Is this information useful?
YesNo
Helpful?