简体   繁体   中英

Disabling a custom date field along with the calendar button right next to it, through client script in suitescript 2.0

In my fieldChanged function, I m trying to DISABLE a date field through field.isDisabled = true; The field gets disabled but the small calendar button on the right remains as it is, which lets the user select the date in the field.

My Code is:

if (cusStatus == 2 || cusStatus == 4 || cusStatus == 7) {
  var compDate = currRec.getField({ fieldId: 'custrecord_sn_trf_dateoperation' });
  compDate.isDisabled = true;
}

This works fine and disables the field, but the calendar button(on the right in the below image) remains there.

在此处输入图片说明

and user can even set the value through the calendar.

在此处输入图片说明

Can anyone suggest how to disable/remove this calendar?

You can simply customize the form and hide that field.

Go to your transaction and then click on Customise -> Customise Form at the top right corner of the transaction: 在此处输入图片说明

Go to the Screen Fields subtab and find your date field, uncheck the "Show" checkbox and the field should be hidden: 在此处输入图片说明

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM