Page 1 of 1

Subform readonly

Posted: Wed Nov 16, 2022 12:14 am
by vanman
Hi

I have a product subform on a quote that when the quote is accepted by the customer I want all objects except a few to be disabled so they can not be changed.

I have tried to disable the subform but the fields can still be changed. Have tried to make a copy of the form that is read only but it can still be changed.

Is there another way to disable the subform and it's contents?

Thanks

Paul

Re: Subform readonly

Posted: Wed Nov 16, 2022 2:20 am
by kev1n
Hi Paul

Based on this post:

Code: Select all

function disableSubform(f, allowInsertions) {

	$('[id ^=' + f + ']').prop("disabled", true);

	if (allowInsertions) {
		const r = nuPad3(nuSubformObject(f).rows.length - 1);
		$('[id ^=' + f + r + ']').prop("disabled", false);
	}

}


if (!nuIsNewRecord()) { // Disable if it's not a new record
	disableSubform("YOUR_SUB_FORM_ID", false); // <------------- replace with your subform id
}


Re: Subform readonly

Posted: Wed Nov 16, 2022 7:42 am
by vanman
Thank You