I've never been great at client scripting, but this is a truly weird one. I'm just trying to disable unit cost on an inventory adjustment. I'm doing that at pageInit, and again at lineInit. Never do I enable the field. If I start a new line, it's disabled, but if I start a new line then click back into the first line, it becomes enabled. I've tried disabling it in every entry point of my client script. Nothing works.
c
Clay Roper
08/17/2023, 8:57 PM
I can't speak to unit cost in particular, but I know some fields resist disabling without funky DOM manipulation. Can you try a different approach, like storing the initial value of that field and replacing it if it's edited?
k
Kevin Baxter
08/17/2023, 8:59 PM
try writing a custom function and calling it
c
creece
08/17/2023, 10:28 PM
They changed something in 2.0 with how line level fields are disabled where if you disable a field its disabled for all lines not just that line. If you want it to be permanently disabled you can set it to disabled on the field record. You may have to go to 1.0 to do some field disabling like you want.
r
reptar
08/17/2023, 10:29 PM
no, thats what i want to happen and its not working that way
c
creece
08/17/2023, 10:30 PM
Does it need to be permanently disabled or line by line?