I have about 45 forms which each have about 100 fi...
# general
j
I have about 45 forms which each have about 100 fields that I need to set disabled. Any faster way to do this than one-by-one like this?
When in doubt, script it out.
Copy code
var prefix = 'custom143flds';

// Get the rows
jQuery('tr[id^="' + prefix + 'row"]').each(function(f) { 

	// Get the row id.
	var row_full_id = jQuery(this).attr('id');
	var row_id = row_full_id.substring(prefix.length + 3, row_full_id.length);
	
	row_id = parseInt(row_id) + 1;

	var ddid = 'inpt_' + prefix + 'display' + row_id;

	jQuery('input[name=' + ddid + ']').val('Disabled');

});
dang it
didn’t work
m
You can try a browser automation tool like kantu or autohotkeys
c
@jen I know this is two weeks late, but are you able to use the SDF to import the form as an object, mass find/replace the
<displayType>
values, and re-deploy to the environment?
j
Nah. Not using SDF, I don’t trust it.
I wrote a
disableFields()
fn that I run in the browser console, lol
I actually ended up writing a few fns to move fields around and set them how I want much more quickly than clicking around in the UI
🌠 1
Copy code
function disableFields() {
	
	var row = 0;
	
	jQuery('#custom229flds_splits tr').each(function(index) {
		
		if(row > 0) {
				
			var inpt = jQuery("input[name='inpt_custom229fldsdisplay" + row + "']").attr('id');
			var hddn = inpt.replace('inpt', 'hddn');
			var indx = inpt.replace('inpt', 'indx');
			
			console.log('row ' + row + ' inpt: ' + inpt);
									
			jQuery('#' + inpt).val('Disabled');
			jQuery('#' + hddn).val('LOCKED');
			jQuery('#' + indx).val(2);			

			nlapiSelectLineItem('custom229flds', row);
			custom229fldsSyncRow(row, false, false, 'custom229fldsdisplay'); 
			custom229fldsRecalcMachine();
			
		}
		
		row++;
		
	});

}
note that
custom229
is specific to my forms but this at least shows the main idea
SUPERHAXX
j
pretty much