Table of Contents

 

Import Object

An Import Object in TDL identifies the type of information that is being imported into TallyPrime. It defines the specific object for which the import operation is performed.

Importable objects can include different types of master and transaction data, such as Groups, Ledgers, Cost Centres, Stock Items, Stock Groups, Vouchers, and other supported objects.

By specifying the Import Object, developers can define what type of data needs to be imported and ensure that the imported information is processed under the appropriate object type in TallyPrime. This helps in organizing the import process and ensures that the data is handled correctly based on its defined structure.

Syntax

[Import Object : <Import Object Name>]

Example

[Import Object : TSPL Ledger]

Object  : Ledger : $Name

Storage : Name   : $Name

In this example, an Import Object named TSPL Ledger is defined for importing Ledger objects. The Object attribute identifies the object type and its identifier, while the Storage attribute maps the imported value to the Name storage of the Ledger during the import process.

➥ Click here to download Import Object Sample

Attributes

The Object attribute is used to specify the type of business object that is being imported into TallyPrime. It identifies the TallyPrime object along with its corresponding object identifier, which helps the import process locate the required object or create a new object, if required. Since different types of business information are represented as objects in TallyPrime, this attribute is useful for defining the specific object to be processed during import. This ensures that the imported data is handled against the appropriate object type and structure.

Syntax

Object : <Object Name> : <Object Identifier>

Where,

<Object Name> specifies the type of object to be imported.

<Object Identifier> is a Expression that uniquely identifies the object during import.

Example

[Import Object : TSPL Ledger]

Object : Ledger : $Name

This example specifies Ledger as the object being imported. The object is identified using the value stored in $Name, enabling TallyPrime to import or identify the appropriate Ledger.

The Storage attribute is used to specify the storage where the imported data is to be stored in the TallyPrime object. It maps the imported value to the corresponding storage of the object during the import process. This attribute helps ensure that each imported value is placed in the appropriate storage, allowing the data to be correctly updated or created in TallyPrime.

Syntax

Storage : <Storage Name> : <Value Expression>

Where,

<Storage Name> Specifies the storage where the imported value will be stored.

<Value Expression> is a Expression that provides the value for the storage.

Example

[Import Object : TSPL Ledger]

Storage : Name : $Name

This example maps the imported Name value to the Name storage of the Ledger object, ensuring that the ledger is created or updated with the imported name.

The Cancel attribute is used specifically when importing Voucher objects from an SDF file. It specifies whether the imported voucher should be marked as cancelled during the import process. This attribute helps retain the cancellation status of the voucher when the data is imported into TallyPrime.

Syntax

Cancel : <Logical Expression>

Where, <Logical Expression> is a Expression that evaluates to Yes or No, indicating whether the voucher should be cancelled.

Example

[Import Object : TSPL Voucher]

Object : Voucher : $MasterId

Cancel : Yes

This example imports a Voucher object and marks it as Cancelled during the import process because the logical value evaluates to Yes.

The Local Formula attribute is used to define temporary formulas within an Import Object definition. These formulas can be reused while mapping imported values to the corresponding fields or storages. Since a formula defined using this attribute is available within the scope of the Import Object, it is useful for simplifying complex expressions, improving readability, and avoiding repetitive formula definitions during the import process.

Syntax

Local Formula : <Formula Name> : <Expression>

Where,

<Formula Name> specifies Name assigned to the local formula.

<Expression> is a  Expression that is evaluated and stored in the local formula.

Example

[Import Object : TSPL Ledger]

Local Formula : IsPrimary : $$IsEmpty:$Parent

This example defines a local formula named IsPrimary, which evaluates whether the Parent field is empty. The formula can be reused within the Import Object definition wherever required.

The Option attribute is used to conditionally apply another Import Object definition during the import process. It allows the import process to select and apply a specific Import Object based on a given logical condition. Since different import scenarios may require different processing rules, this attribute is useful for extending or modifying the import behavior based on the condition, making the import definition more flexible and adaptable.

Syntax

Option : <Import Object Name> : <Logical Condition>

Where,

<Import Object Name> Specifies the optional Import Object definition.

<Logical Condition> is a Expression that determines whether the optional definition should be applied.

Example

[Import Object : TSPL Ledger]

Option : TSPL Primary Ledger : $$IsEmpty:$Parent

This example applies the TSPL Primary Ledger Import Object only when the Parent field is empty, allowing different import behavior for primary ledgers.

The Repeat attribute is used to define the next level of objects that need to be imported. It establishes the relationship between a parent object and its child Import Object definition, enabling hierarchical data import.

Syntax

Repeat : <Object Name> : <Import Object Definition>

Where,

<Object Name> Specifies the child object.

<Import Object Definition> Specifies the Import Object definition used for importing the child object.

Example

[Import Object : TSPL Voucher]

Repeat : Inventory Entries : TSPL Inventory Entry

This example specifies that the Inventory Entries object should be imported using the TSPL Inventory Entry Import Object definition, enabling import of voucher line items.

The Switch attribute provides a conditional way to apply an optional Import Object definition, similar to the Option attribute. However, it improves performance by grouping related conditions using a label. Once a condition within a group evaluates to true, the remaining Switch conditions in the same group are skipped, while conditions in other groups continue to be evaluated.

Syntax

Switch : <Group Label> : <Optional Import Object> : <Logical Condition>

Where,

<Group Label> Specifies the label used to group related Switch conditions.

<Optional Import Object> Specifies the Import Object definition that is applied when the condition is satisfied.

<Logical Condition> Expression that evaluates to Yes or No to determine whether the optional definition should be applied.

Example

[Import Object : TSPL Ledger]

Switch : LedgerType : TSPL Primary Ledger   : $$IsEmpty:$Parent

Switch : LedgerType : TSPL Group Ledger     : NOT $$IsEmpty:$Parent

In this example, both Switch statements belong to the LedgerType group. If the Parent field is empty, the TSPL Primary Ledger definition is applied, and the second Switch in the same group is skipped. If the condition is not satisfied, the next Switch is evaluated, and TSPL Group Ledger is applied when the Parent field is available. This ensures only one matching definition from the LedgerType group is selected, making the evaluation more efficient than using multiple Option attributes.

Is this information useful?
YesNo
TallyHelpwhatsAppbanner
Is this information useful?
YesNo
TARA