Business is all about managing men, material and resources. and to manage its aim in business a good communication is an essential part. TDL help you in establishing such good and personalised communication. Think in your organisation if you send an automated Birthdate greeting to your clients/suppliers/employees. They will feel happy for you. So how can we do this through TDL?
First step to do this goal, we need a special field in our ledger master which stores Date of Birth of 3rd parties. Let’s see how can we create this field with a little line of coding in Tally.ERP 9.
In Tally it is known as UDF (User Defined Field) because a programmer here define a field himself.
In this chapter we will deal only with creating a UDF in the ledger Master.
This example illustrates how you can create a UDF in ledger master
First Let’s see a typical ledger master Screen.
I have created a new company and will be creating a new ledger
The ledger master creation screen looks like this
Now, This Ledger Master has several parts I will explain what is Parts in Tally TDL
At this moment, you just note that in TDL there are various parts
Now, I need to find out where to Add a new line and new field ? Once I find the concerned part to modify then only I can add a new UDF or to amend that part.
We will look how to find out a part in an another chapter.
At this moment, I want to show you that Let me add a new field below the Website as you can see in the attached screen shot
We will add a new line and a new filed to that.
Here is the code, I will write in my Tally Developer Network
#Led Contact ]
Add :Lines : Ledger DOB
[Line : Ledger DOB]
Fields : Medium prompt, Led DOB
Local : Field : Medium Prompt : Set as : “ Date of Birth :”
[Field : Ledger DOB]
Use : Uni Date Field
Storage : BirthDate
[System : UDF]
BirthDate : Date : 70001
Now, Save the file in Tally.ERP 9 and run your Tally after refreshing it.
I have completed this TDL in my TDL developer and saved it with the file name DOB.Txt
Here is the screen shot of my Tally Developer with this code
Now, if you run this TDL in The Tally.ERP 9, you will face an error and your Tally.ERP 9 will stop working and will exit! Why?
Because a bug in coding in programming language cause an application to run. So, to cure this bug, let’s come back to our Tally Developer
See the screen shot above you can see the red colour in the left side which is suggesting there is something wrong
This is benefit of using Tally Developer Software to code because it will highlight such errors by different colour. Also it will give you different color for syntax, definition etc and it is very comfortable to use the Developer Environment Software to prepare your Tally TDL
Now, looking at the code, I found that I missed to put the opening [ (Square bracket ) and field definition which I want to amend in the first like. So, the mistakes seems to be in line one only and I will amend the first line as below :
[#Part : Led Contact ]
Now,let’s test this code in the Tally.ERP 9. Don’t worry I will explain you the code line by line.
Caution : Write your Tally TDL code only in notepad or in the Tally Developer Network
If you write this code in MS Office or any other application then it may not work properly
Even if you write this codes in MS office or other than Notepad and then copy paste them in Notepad or in Tally Developer Notepad, it will not work. So write only either in Notepad or in Tally TDL
The Final code will look like this :
Add : Line: Ledger DOB
[Line : Ledger DOB ]
Field : Medium Prompt, LED DOB
Local : Field : Medium Prompt : Set as: “Date of Birth”
[Field : LED DOB]
Use: Uni Date Field
Storage : BirthDate
[System : UDF]
BirthDate : Date : 10001
In Next chapter we will go through line by line of this code how did it worked and what each line and code suggests
Here is your assignment to follow for this chapter
01 ) Add a new field which ask for Party Facebook Profile in the party ledger Master
02) It should store the Facebook profile permanently
In next chapter, we will look more deeply to this codes!