The subject line is the question.
public WOComponent newObjectForEntityName(String entityName) {
WOComponent nextPage = null;
try {
EditPageInterface epi = D2W.factory().editPageForNewObjectWithEntityNamed(entityName, session());
epi.setNextPage(session().context().page());
nextPage = (WOComponent) epi;
} catch (IllegalArgumentException e) {
ErrorPageInterface epf = D2W.factory().errorPage(session());
epf.setMessage(e.toString());
epf.setNextPage(session().context().page());
nextPage = (WOComponent) epf;
}
return nextPage;
}
Thanks
James