In this post, we will learn about how to create a user-defined field (UDF) / customized field in Tally software on any screen using Tally Developer software.
So before we start you will need to install Tally.ERP9 software and Tally Developer software and configure it. To know how to do that click here.
Let’s Learn how to create a User Defined Field (UDF)/ Customized Field in Tally Software
After Installing Tally Developer software open it by double-clicking the icon on your desktop.
- Go to Files option in the top menu and click on New Project option. And it should open below the screen for you.
- Give any name to your project. In my case, I will be giving name My First TDL.
- After Providing name click on the 3 dots in location line and give the path where you want to save this project. And your project is ready for adding files to it.
- Now click on Add New Files option and provide a path and give the name to your file. In my case in am giving file name a My First TDL.
- You can also add existing files if you already have it by clicking Add Existing files option.
- Or if you want to remove any files from the project you can just select the file and click on Remove Selected.
- So now as you have created the project and also its file just click on save. And your Tally Developer screen should look like below.
- Now Select the File and Lets Start Writing the code
Free Tally Learning code for how to create UDF / Customized Field in Tally.
Before we Start we need to know how Tally data structure is? In Tally each and every screen starts with Menu-> Report->Form->Part->Line->Field
Tally Menu:—- A Menu is a place in which we have the option or we can say place through which we can navigate in our software. The menu can have sub menus
Tally Report:— Each and every screen in Tally is known as Report. And It contains the form.
Tally Form:- A form is the each which we can see on our screen.
Tally Part:— A Part is a place in the form. Example Left Part, Right Part, Top Part, Bottom Part or Part.
Tally Line:— Line is the place where we can place our fields and it is located in Part.
Tally Field:— A Field is were we show or enter our Data.
So to Create a UDF / Customized Field first you need to know where you want your field to be located. In our case, we will just take an example of Adding field on our Sales screen right after Ledger Selection field.
So as we need to place our field just after Ledger Selection Field. We first need to know the Report Name, Form name, Which Part the Ledger Selection field is and what is the name of the Ledger Selection Field. To Find out please follow the below steps.
As we have already configured our Tally Developer Software and Tally.ERP 9 Software we can right-click on our project and click on Execute Tally.
by Clicking on it your Tally Should start in a Developer mode. Select the company and go to Sales Voucher.
Take your mouse over ledger selection field it should show you the Field name which Tally uses for development purpose.
So now we know the field name after which we want our field. Go back to Tally Developer and click in Navigate in Menu Bar.
Select Jump to Definition and it should open below Screen.
At Jump to Screen Select Form at First option And Select EIDefaultBill from the list so that Default voucher screen code gets open. We have Select this because Tally uses this a Base code for every voucher. Now Scroll down and find the line which contains the name of the Ledger Selection Field.
Now Copy the name of the Line were you found the field name. and past it into our file.
Add # before the word line ( # is used to call the Tally Default Field, Line, Part, Form, Report, Menu).
Then Add the below Code after it. In the second Line.
Add: Field: After:Name field: CustomerNamePrompt ;;;;;;; This will add one new field at the last of that line with its name as CustomerNamePrompt. You can give it anything you want. But remember it should not be available in Tally
Now as we have added a field. Now we need to Define the field in Tally for you will need to Write the Below code.
Use: Name Field
Here we are defining the field and informing Tally that this is just a Normal Name Field which we contain any text. You can have other different field types too like Simple Field, Simple Prompt, Medium Prompt, Logical Field Etc……
Now that we have, Define the field we need to create storage for that field so that data which is entered in that field gets saved in a tally. For that, you need to write below code.
Now our code is complete and to check whether it is correct or not Execute Tally from Tally Developer as said earlier. And go to Sales voucher and check. It should look like below.
Now you can use this field for Entering Data.