Reference Radio Buttons

Viewing 2 reply threads
  • Author
    Posts
  • June 12, 2024 at 3:54 AM #50788

    Stephen
    Participant

    I have a field for progress Status, it’s formatted as radio buttons from a pick list with 3 values – Pending/Actioned/Archived.

    I would like to set the record colour based on this status. null/yellow/green.

    I have used the set record colour attribute before, but only set from a tick box, so the logic was simple. Try as I might, I cannot find how to achieve what I want. How is the value of a Radio Button field stored & referenced in the script, for example? I’ve tried as if it were the text, and if it was stored as a number, but no success thus far.

    Any advice?

     

    Many thanks, Stephen.

     

    June 13, 2024 at 1:30 PM #50791

    Brendan
    Keymaster

    Hi Stephen,

    Just setting the value in the field should trigger the record colour value to update. Can you post a sample form template with your script inside so I can see what’s going wrong?

    Even something simple like this works:

    function Change_Value() {
    var new_field_id = 'fld-eeda81519fa94abab133b9a2b4d7847b';
    record.setFieldValue(new_field_id, "Two");
    form.saveAllChanges();
    }
    Change_Value();

    Have you made sure that you’re calling form.saveAllChanges()?

    Attachments:
    You must be logged in to view attached files.
    June 13, 2024 at 1:44 PM #50793

    Stephen
    Participant

    Hi Brendan, to try and chip away at solving it myself, I dropped back to just relying on three check marks for the status, but I ideally want these to be mutually exclusive, as radio buttons.

    I’ve exported and attached the form.

    With thanks, Stephen.

    Attachments:
    You must be logged in to view attached files.
Viewing 2 reply threads

You must be logged in to reply to this topic.