jen
06/29/2022, 10:42 PMfield.isDisplay
from the context.newRecord because this isn’t in dynamic mode. Any suggestions? Basically, I need to form.insert()
a new field but only if a related field is visible on the form.Eric B
06/29/2022, 10:57 PMvar field = form.getField({
id : 'textfield'
});
jen
06/29/2022, 11:01 PMjen
06/29/2022, 11:01 PMjen
06/29/2022, 11:01 PMinsertField
doesn’t actually put it where I want in UEjen
06/29/2022, 11:01 PMEric B
06/29/2022, 11:03 PMjen
06/29/2022, 11:04 PMjen
06/29/2022, 11:04 PMjen
06/29/2022, 11:05 PMjen
06/29/2022, 11:05 PMvar my_pre_existing_field = context.newRecord.getField({fieldId: 'custbody_my_pre_existing_field'});
// Check somehow that this exists and is visible....
if(exists and is visible) {
var my_new_field = context.form.addField({
id: 'custpage_my_new_field,
type: serverWidget.FieldType.URL,
label: 'My New Field'
}).defaultValue = my_url;
context.form.insertField({field: my_new_field, nextfield:'custbody_my_pre_existing_field'});
}
jen
06/29/2022, 11:06 PMif(field_exists_and_is_visible)
addNewFieldBeforeIt();
jen
06/29/2022, 11:06 PMEric B
06/29/2022, 11:10 PMjen
06/29/2022, 11:13 PMEric B
06/29/2022, 11:14 PMEric B
06/29/2022, 11:16 PMjen
06/29/2022, 11:22 PMjen
06/29/2022, 11:22 PMjen
06/29/2022, 11:23 PMEric B
06/29/2022, 11:26 PMEric B
06/29/2022, 11:26 PMEric B
06/29/2022, 11:27 PMjen
06/29/2022, 11:30 PMEric B
06/29/2022, 11:31 PMjen
06/29/2022, 11:31 PMjen
06/29/2022, 11:32 PMjen
06/29/2022, 11:32 PMjen
06/29/2022, 11:32 PMEric B
06/29/2022, 11:34 PMjen
06/29/2022, 11:34 PMjen
06/29/2022, 11:35 PMjen
06/29/2022, 11:36 PMform.addField
jen
06/29/2022, 11:37 PMform
Marvin
06/30/2022, 4:05 AMvar my_pre_existing_field = context.newRecord.getField({fieldId: 'custbody_my_pre_existing_field'});
if (my_pre_existing_field) {
my_pre_existing_field.setDisplayType('normal');
}
I don't any properties to query regarding whether it's hidden or not in the v1 documentation for nlobjField
. I would try logging the object and seeing if you can find properties like isDisplay
isHidden
...etc.dcrsmith
06/30/2022, 11:13 PMlog.debug('form field',ctx.form.getField({id:'custbody_ks_bb_vendor_rep_list'}))
jen
06/30/2022, 11:18 PMjen
06/30/2022, 11:19 PMfield
object that’s returned by context.form.getField()
is the same regardless of whether or not it’s a form that shows the field.dcrsmith
06/30/2022, 11:21 PMdcrsmith
06/30/2022, 11:26 PMjen
06/30/2022, 11:31 PMjen
06/30/2022, 11:31 PMjen
06/30/2022, 11:32 PMjen
06/30/2022, 11:32 PMdcrsmith
06/30/2022, 11:33 PMjen
06/30/2022, 11:33 PM