Search Results for 'script'
-
Search Results
-
A javascript runs correctly with a “hard coded” field_ID. It fails however if the field_ID is retrieved using the functions ‘form.getFieldNamed(‘field_name’)’ and ‘object.getId()’.Can anyone see why this might not work? I intend to use this function in ALL of my forms. Hence the need to source the field_ID from its ‘field name”.Thanks for any help.The code is quite straightforward (you can substitute any field id below to test it). If the user enters “XXYY” in the field, it should set that field to ‘null’:function Script() {// ***** OPERATES CORRECTLY *****:// the following two lines of code work correctly (when the field id// hardcoded).var analysis_g2_fld_id = ‘fld-37435e1d73024374b4700105e49993c9’;var analysis_g2_value = record.getFieldValue(‘fld-37435e1d73024374b4700105e49993c9’);// ***** FAILS *****:// the following three lines of code do NOT work// (ie. when the field ID is sourced via functions). If the three// lines of code below are executed in a “form level script”, it does// work. It is only when in a “field level script” that it fails.// analysis_g2_obj = form.getFieldNamed(‘Analysis_G2’);// var analysis_g2_fld_id = analysis_g2_obj.getId();// var analysis_g2_value = record.getFieldValue(analysis_g2_fld_id);if (analysis_g2_value == “XXYY”)record.setFieldValue(analysis_g2_fld_id, null);return 0;}Script();form.saveAllChanges();
Topic: Reference Radio Buttons
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.
Hello,
following assumption:
I have two forms:
form 1
form 2
I have a script in form 1 (not a script field). How can I get the records that are in form 2 from form 1 and display it in the console?
I tried several days but I can not access the records in form 2.
Regards from germany.