jkabot
05/15/2018, 5:35 PMbeforeLoad
user event if that matters). I have it start off hidden and only want to make it visible later on if certain conditions are met client-side.
const field = ctx.currentRecord.getField({ fieldId: 'custpage_item' });
field.isDisplay = true; // does not work
field.isVisible = true; // does not work
karlenigma
05/15/2018, 7:36 PMkarlenigma
05/15/2018, 7:36 PMjkabot
05/15/2018, 7:42 PMupdateFieldDisplayType
is only available to server scripts as part of the N/ui/serverWidget
module 🙁
I decided to just leave have it start off disabled and then enable it using field.isDisabled = true
which works fine.karlenigma
05/15/2018, 7:45 PMkarlenigma
05/16/2018, 8:00 AMfunction disableField(currentRecord,myFieldID,truefalse) {
var disable = currentRecord.getField({fieldId: myFieldID}); // myFieldID is the second parameter passed through on the function from the client script.
disable.isDisabled = truefalse; // disable said field
}
function displayField(currentRecord,myFieldID,truefalse) {
var display = currentRecord.getField({fieldId: myFieldID}); // myFieldID is the second parameter passed through on the function from the client script.
display.isDisplay = truefalse; // hide said field
}
function makeMand(currentRecord,myFieldID,truefalse) {
var makeMand = currentRecord.getField({fieldId: myFieldID}); // myFieldID is the second parameter passed through on the function from the client script.
makeMand.isMandatory = truefalse; // hide said field
}
karlenigma
05/16/2018, 8:01 AMjkabot
05/17/2018, 5:55 PMisDisplay
should work (in theory). I think my case might be different because I started it off hidden server side (and would only become unhidden client side).
I ended up compromising by starting it off disabled server side (and later enabling it client side), which works for what I needkarlenigma
05/17/2018, 5:56 PM