This topic contains 4 replies, has 0 voices, and was last updated by TheUsualSuspect 7 years, 3 months ago.

  • Author
    Posts
  • #18223

    mushrush

    Is it possible in SS 2.0 to set the display type of a field. i.e.: disabled, hidden, in-line, normal, etc

    Thanks!
    This is a cached copy. Click here to see the original post.

  • #18224

    girieshg

    Yes. Take a look at the documentation in the Help Center, for the Field.updateDisplayType() method under the N/ui/serverWidget module.

  • #18225

    TheUsualSuspect

    If you are talking about on a client script the answer is also yes. You have to grab the field using either currentRecord.getField or currentRecord.getSublistField and set the attribute directly unless I’m missing something. Someone please let me know if I am.

    Here is some client script sample code.

    Code:
    cr.getField({fieldId:’memo’}).isDisabled = true;
    cr.getField({fieldId:’memo’}).isDisplay= true;
    cr.getSublistField({ sublistId: ‘item’, fieldId: ‘rate’, line: 0, }).isDisabled = true; // sets all line fields disabled regardless of which line you select
    The only gotcha / gap / bug is that you can’t disable a line field if there isn’t at least one committed line since you have to select the field directly to perform these actions and a field doesn’t exist until the line is committed. I’d recommend 1.0 in the case that you have to work with line fields

    If you do need to set this on a suitelet or user event then use the serverWidget functions as mentioned above

  • #18226

    mushrush

    TheUsualSuspect I have attempted to use your method shown above to set the isDisabled = false. However, it does not seem to be working. Is this possible to do in a Client Script? Also, this attribute (isDisabled) does not auto popup in Eclipse when coding as-if it is not an available attribute. Any ideas?

    For now I have created a workflow to handle my field display type/behavior.

    Thank you for your response!

  • #18227

    TheUsualSuspect

    Originally posted by mushrush

    View Post

    TheUsualSuspect I have attempted to use your method shown above to set the isDisabled = false. However, it does not seem to be working. Is this possible to do in a Client Script? Also, this attribute (isDisabled) does not auto popup in Eclipse when coding as-if it is not an available attribute. Any ideas?

    For now I have created a workflow to handle my field display type/behavior.

    Thank you for your response!

    If you have a workflow that can handle the logic I’d stay with that. It is possible to do in a client script though. I have a gif attached showing a proof of concept on a trandate field on an SO…but i can’t get it to display right. The still image shows the code however.

You must be logged in to reply to this topic.