Note Field Font Color

Viewing 2 reply threads
  • Author
    Posts
  • February 3, 2020 at 12:27 AM #39441

    obisbis
    Participant

    Hi all, I’m wondering if there is away to programmatically change the color of text in a note field. Here is what I’m trying to do:

    – Retrieve data from an external website
    – parse the content of the retrieved data and based on certain criteria change the color of text and/or it’s format before adding to a note field.

    var url = “somewebsite”;
    var data = Utils.getTextFromUrl(url);
    data.fontcolor(“red”); // something like this

    record.setFieldValue(note_id, data);
    form.saveAllChanges();

    Any help is appreciated.

    Thanks!

    February 3, 2020 at 2:24 AM #39443

    Brendan
    Keymaster

    Hi Obisbis,

    If you switch the Note field to be a Plain Text Note field, then the colour of the font can be set.

    var note_field = form.getFieldNamed("My Note");
    note_field.valueColour = "#C90000";
    
    form.saveAllChanges();

    You can’t adjust individual blocks of text or characters within a Note field using scripts. I haven’t added an API for that.

    February 3, 2020 at 3:12 AM #39446

    obisbis
    Participant

    Ya, that works. Thanks!

Viewing 2 reply threads

You must be logged in to reply to this topic.