;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara /* Objective(s) - This program illustrates the use of following attributes of Field Table Table Search Common Table Default Table Item Show Table Trigger Dynamic Skip Action Key Use Skip Storage Skip SysNames Sub Title Unique Wide Space On */ [#Menu: Gateway of Tally] Add: Item: ($$LocaleString:"Repeated Table Storage") : Alter: TSPL Field Table [Report: TSPL Field Table] Form : TSPL Field Table Object : Company : ##SVCurrentCompany ;;Report is set with current company object context, so that the aggregate udf values get stored in te company object [Form: TSPL Field Table] Use : Small Size Form Parts : TSPL Field Table Width : 40% Screen Height : 80% Screen [Part: TSPL Field Table] Lines : TSPL Field Table Main Title, TSPL Field Table Title, TSPL Field Table Repeat : TSPL Field Table: FavouriteCustomers ;;Line is repeated on the aggregate udf in which the values need to be stored Break On : $$IsEndOfList:#TSPLFieldTable Scroll : Vertical Common Border: Yes [Line: TSPL Field Table Main Title] Field: TSPL Field Table Main Title [Field: TSPL Field Table Main Title] Use : NameField ;;Already defined field NameField is used here Set as : $$LocaleString:"List of Favourite Customers" Wide Space : Yes ;;The text will be displayed with space between each character Full Width : Yes Align : Center Sub Title : Yes ;;The borders will not run through the text [Line: TSPL Field Table Title] Field : TSPL Field Table, TSPL Field Rating Border : Thin Box Local: Field: Default : Delete: Storage Local: Field: Default : Delete: Table Local: Field: TSPL Field Table : Info: $$LocaleString:"Customer Name" Local: Field: TSPL Field Rating: Type: String Local: Field: TSPL Field Rating: Info: $$LocaleString:"Rating(0 to 5)" Local: Field: TSPL Field Table : Border: Thin Right [Line: TSPL Field Table] Field : TSPL Field Table, TSPL Field Rating [Field: TSPL Field Table] Use : NameField Table : TSPL Ledger Table, EndOfList, CreateMaster ;;Ledger list along with with Endof list is shown in the table Show Table : Always ;;Table is shown always when the cursor is on the field Table Search: Yes: Yes ;;reducing search on all columns is enabled Unique : Yes ;;User is resticted from selecting duplicate values in the field Common Table: Yes ;;Table is generated once and used in the repeated line Full Width : Yes Storage : FavCustName ;; Value is stored in the UDF part of the aggregate udf on which lie is repeating ;Default Table Item : If $$line =1 then NOT $$IsSysName:$Name else NO ;; when field has no value, the table cursor will be on first ledger if line number is 1 else no default item is specified and it will depend on skip action specified Trigger : Ledger, yes : $$IsSysNameEqual:CreateNew:$$EditData ;;opens Ledger creation report when user selects Create Skip SysNames : No ;; System names even if selected will not be stored Skip Action : Yes ;; Cursor skips the action objects in table and is placed on first object after action object if default item evaluates to no Key : Create Ledger ;;When Alt+C is pressed on the field, user can create ledger which is automatically selcted in the field if it belongs to creditors or debtors [Field: TSPL Field Rating] Use : Number Field Max : 1 ;;only one number can be entered Width : 12 Table : TSPL Rating, New Number Show Table : Always Trigger : NewNumber : $$IsSysNameEqual:NewNumber:$$EditData ;;Shows a report when new number is selected from the table Dynamic : "" ;;Makes the table dynamic so that the field valus is part of the table Storage : FavCustRating ;;Value is stored in the UDF part of the aggregate udf on which lie is repeating Skip : $$IsEndOfList:#TSPLFieldTable ;; This field is skipped if endoflist is selected in the ledger field Control : TSPLRatingControl : @RatingCond ;;If user enters values other than from the range 0 to 5, a message pops up and user is not allowed to accept the field utill te input is between 0 and 5 RatingCond : $$Value <0 OR $$Value >5 ;;Local Formula used in Control attribute On : Accept : Yes: Call: TSPLLedUpdate:#TSPLFieldTable:$$EditData ;; On field accept, The rating is updated in the ledger object On : Accept : Yes: Field Accept ;; Since field accept was overriden its neccessary to inform the system, now it can accept the field and move forward ;;Function specified in On attribute in the field attribute to update the ledger with Rating [Function: TSPLLedUpdate] Parameter: LedName : String Parameter: LedRank : Number Object: Ledger : ##LedName 01: SET TARGET 02: Set Value: FavCustRating : ##LedRank 06: ACCEPT ALTER ;;The Collection used in the Table attribute of the field [Collection: TSPL Ledger Table] Type : Ledger Title : $$LocaleString:"Ledger Select" ;; title displayed in the table Sub Title: $$LocaleString:"Name", $$LocaleString:"Group" ;; the titles of the the columns Fetch : Name, Parent, FavCustRating Format : $Name, 20 ;;First column value and width of the column Format : $Parent, 20 ;;Second column value and width of the column Filter : TSPLCustomerFilter ;; Only Ledgers belonging to Sundry Debtors or Sundry Creditors are shown ;;Colection to list the ratings for seletion [Collection: TSPL Rating] List Name: 0,1,2,3,4,5 [System: Formula] TSPLCustomerFilter: $$IsLedOfGrp:$Name:$$GroupSundryCreditors OR $$IsLedOfGrp:$Name:$$GroupSundryDebtors ;; System formula used in Collection Filter attribute TSPLRatingControl : $$LocaleString:"Rating should be between 0 and 5" ;; System Formula used in control attribute of the field [System: UDF] FavouriteCustomers : Aggregate : 23455 ;;Aggregate UDF on which the Line repeats FavCustName : String : 23568 ;;UDF that is used in storage attribute of field to store the ledger name FavCustRating : Number : 23678 ;;UDF that is used in storage attribute of field to store the rating ;;EOF