I have noticed that, for a given field in a custom...
# suitescript
r
I have noticed that, for a given field in a custom record, with the option SHOW IN LIST set to true, and DISPLAY TYPE set to DISABLED, when you try to update the value (User Event - AfterSubmit), it does not work. If I set the option SHOW IN LIST to false, and DISPLAY TYPE remains set to disabled, the very same code works as expected and updates the value. Any idea what's going on? Is this expected?
b
what does the code look like
r
I cannot paste all here, but basically the relevant line when setting the value looks like this:
Copy code
childRecord.setValue({
                fieldId: "customfieldid",
                value: parseFloat(value).toFixed(4)
            });
So I do not use any of the options of setValue. Server side, UE script. Basically is a child record that is attached to a parent record. So for some fields of the child record, we set the option SHOW IN LIST to true, so the user can see those fields when editing the parent (enable child editing is also enabled), but he cannot edit it (Display Type set to DISABLED). Some logic is applied upon either saving the child or the parent. On both cases, the field in question is update correctly if SHOW IN LIST is set to false, but is not if SHOW IN LIST is set to true. So I do believe the code should not be an issue.
b
probably because the field is disabled
you can set any fields on the child from the parent using the sublist, even those that arent shown
showing it probably means that the sublist now knows that the field is disabled and cant be set
actually, i missed that you arent using the sublist
if you arent using the sublist, i dont think the show in list should have any effect at all
r
Thanks for your input. Thing is that I never found an issue with Disabled before, even in the help is stated that can be use for code
Copy code
Disabled - Cannot be edited. You can use this field with custom code calculations, defaulting and sourcing information only. Any field with a display type of disabled that does not have default, sourced or custom code information will not display on forms.
I am actually loading the child record and saving it, so not doing it directly from the parent using the sublist. Reason for this is that I am executing pretty much the same function if the user triggers the script in the parent record or in the child record. If is triggered in the child record page, it find out which one is the parent, it loads the parent, load the childs, do the stuff in the childs, save the childs and then change something in the parent, saves the parent. If is triggered in the parent, load the childs, do the stuff in the childs, save the childs and then change something in the parent, saves the parent. I have retested again to made sure I miss something before. So, from a child record, I save it, and the field subject to test in the child record gets update as expected (if show in list uncheck). Then I retested (with show in list check for the field subject to test) and it does not work.
I guess if nobody else has noticed this, the way forward might be to create an smaller example, with a simple function and open a case. To be honest I can work around this issue, is fine to not displayed those fields, so I will not open the case for now
It took me some time to realise the problem though