I am not able to create a Lookup to Task, EmailMessage and couple of other objects . So looks like there is a known limitation and hence Task and EmailMessage objects are not available in RelatedTo dropdown while creating lookup relationship field.
So I am trying to create objects for Task, EmailMessage etc dynamically and read records for these objects .
Can I place these object API names in meta data (Task, EmailMessage etc ) and read the string and split it based on delimeter and create objects ?
String ObjList = 'Task,EmailMessage' ( read from meta data)
sObject obj = Schema.getGlobalDescribe().get(lateBoundType).newSObject();