Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
Code Block | ||
---|---|---|
| ||
import org.joget.apps.app.dao.FormDefinitionDao;
import org.joget.apps.app.model.FormDefinition;
import org.joget.apps.app.model.AppDefinition;
import org.joget.apps.app.service.AppUtil;
import org.joget.apps.form.model.Form;
import org.joget.apps.form.service.FormService;
AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");
FormDefinitionDao formDefinitionDao = (FormDefinitionDao) AppUtil.getApplicationContext().getBean("formDefinitionDao");
FormService formService = (FormService) AppUtil.getApplicationContext().getBean("formService");
String id = "crm_account";
String appId = "crm";
Long appVersion = appService.getPublishedVersion(appId);
AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());
FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);
if (formDef != null) {
//create the form
Form form = (Form) formService.createElementFromJson(formDef.getJson(), true);
} |
...