Error Object Framework
In TallyPrime, all incoming data including errors are persisted during Rewrite, Migrate, Import, and Sync. It never gets ignored and the user manually resolve these errors. To serve these error objects and their counts to application layer, we have enhanced TDL with a capability which expresses the intent to retrieve these errors. These capabilities help the developers
- To gather the collections based on the criteria specified in the TDL
- To provide the count of error objects. It makes the Reports and Drill-down reports instantaneous.
Functions
$$HasDataErrors
The function HasDataErrors is used to know whether the errors are present for a given activity or not.
Syntax
$$HasDataErrors:<Activity>
Where,
<Activity> is used to get the count of all masters for the specified activity. The possible values of the activity are Sync, Import, Migrate, Repair, and Any.
Example
$$HasDataErrors:”Sync”
Collections
There are a few collection changes related to the error object framework.
Case 1: If the Type attribute of collection definition contains both error object and activity, then the Child Of attribute must identify the activity from which the error object needs to be gathered.
This can be mentioned as given below:
[Collection: List of Error Objects]
Type :<ErrorObjects>[:<Activity>/ <Rule>]
Child Of: Sync/Rewrite/Migration/Import or <Rule Master Name>
In the above example, the Activity/Rule are keywords. If the keyword Rule is mentioned, always the activity would be ‘Sync’.
Example:
- To get all master errors irrespective of activity
Type : ErrorMasters
- To get all Ledger errors irrespective of activity
Type: ErrorLedger
- To get all ledger errors from the Sync activity
Type : ErrorLedger : Activity
Child Of: Sync
- To get all voucher errors irrespective of activity
Type: ErrorVouchers
- To get Error Ledgers from Sync activity
[Collection : Error Ledgers]
Type : ErrorLedger: Activity
Child of : Sync
- To get Error Ledgers from Sync activity and for Rule Master ‘RuleABCD’
[Collection : Error Ledgers for Rule]
Type : ErrorLedgers: Rule
Child of : RuleABCD
- To get Error Vouchers for Sync activity
[Collection : All Sync Error Vouchers]
Type :ErrorVouchers:Activity
Child of : Sync
- To get Error Vouchers of a particular voucher type for Sync activity
[Collection : All Sync Error Vouchers of a Voucher type]
Source Collection : All Sync Error Vouchers
By : VchType : $VoucherTypeName
Aggregate Compute : Count : Sum : 1
If voucher type (payment, sales etc) is missing it will be shown as uncategorized.
Error wise collections
[Collection : All Sync Error Ledgers error wise]
Source Collection : Error Ledgers
By : Error Type : $ErrorType
Aggregate Compute : Count : Sum : 1