Skip to main content
1 of 2

This shouldn't actually cause a dependency on the object named by ObjectName (which may be in another package):

Schema.getGlobalDescribe().get(ObjectName).newSObject();

I am working on a prototype at the moment using this technique.

Actually, in my prototype I don't even have the base package installed in my packaging org - as in this prototype I wanted to see how far I could go avoiding any package dependencies. I have unmanaged proxy objects in my packaging org for test purposes, and these objects are not included in my package. The application can work with either unmanaged objects or managed packaged objects (naturally I need to prefix the namespace in the latter case).