How do I populate a field/element in a form with a value from another field/element in a form?
Help please,
I would like to concat the first and last name that a user enters in the CRM app when in add mode. In the Knowledge base, I have found this example:
Choose Bean Shell Form Binder as the Form's Store Binder.
Key in the following code.
importorg.joget.apps.app.service.AppUtil;importorg.joget.apps.form.model.Element;importorg.joget.apps.form.model.FormRowSet;importorg.joget.apps.form.model.FormData;importorg.joget.apps.form.lib.WorkflowFormBinder;importorg.joget.commons.util.LogUtil;importjava.sql.Connection;importjava.sql.SQLException;importjavax.sql.DataSource;
rows.get(0).setProperty("field2", rows.get(0).getProperty("field1"));
newWorkflowFormBinder().store(element, rows, formData);In the code above, it will copy the value from form element with id "field1" into "field2".
- Save the form.
Will this work? if so, how do I use this option? Is there a better way to do this? And where do I find the "Form's Store Binder?
"Choose Bean Shell Form Binder as the Form's Store Binder." (I am using the enterprise version)