Suppose you have a form A that calls form B.
In Form B you want to know what is the data source of the Form A and do something…..
This is the code to obtain the data source name of a caller object (such as Form, menu item, etc..).
args.record().dataSource().Name();