Hi Akhil,
Please check this documentation on how to create UDFs
http://www.pioneerb1.com/wp-content/uploads/2012/06/How-to-Create-User-Defined-Fields-and-Tables.pdf
In addition check this youtube video on how to create User Defined Fields
SAP Business One - User-defined fields - YouTube
You could use formatted search to do query manipulations or select data from other SBO tables.
I hope it would be useful in your case.
Best,
Paul.