If you only wanted to pass the Id, you could use SDescribe API calls to get the list of all available objects, iterate the result, get the key prefix for each and then compare that against the Id you have to determine which SObject the Id belongs to. I don’t think this is what you are asking nor would it be very efficient but technically it would be possible hence why I’m mentioning it.
This will only get you so far though since you might display the “Name” field of the parent on the page title, but in other cases you might want to display a different field.
If you had a finite number of possible parent objects (let’s say a handful) there are some options here but since your parent could be hundreds of potential objects you need something more flexible.
Possibly I’m still mis-understanding the objective or maybe over (or under) thinking it, but here’s my thoughts:
1) Create a custom object in salesforce that contains fields for the type of information you will want to display on the logs page
2) Create a popup that has two models - One for tasks (TaskModel) and one for the new custom object (ParentModel)
3) Pass the Id and object name to the popup
4) Set the condition on TaskModel to be the Id in Url parameter for ParentId of task
5) Dynamically create a row in the ParentModel using the following approach
- Create a model based on the parent object name from the url
- Set the condition on the model to the Id from the url
- load the data for the model
- take the resulting row and create a row for ParentModel based on fields that you know for that object correspond to the ParentModel fields that you are going to display
What this would let you do is standardize fields and still use declarative approach for building the popup page itself. For example, let’s say that if the parent is Account, you want the Page title to use Account.Name but if the parent is Opportunity, you want the page title to display Opportunity.Description. ParentModel.Name would contain the appropriate “Name” field from the target object because you handled the translation in code.
Hopefully this helps??