Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Script Talk › On the layout is not shown new value
- This topic has 7 replies, 3 voices, and was last updated 1 year, 5 months ago by Brendan.
-
AuthorPosts
-
May 28, 2023 at 4:43 AM #49487
PavelParticipantI use SetFieldValue function for setting some fields. After set value and use SaveAllChanges, new value is not displayed. On console I see new value but in layout not.
If I change value of field manually, I still see old value on console. Value is change when I close and open file. Any tips?May 29, 2023 at 1:19 PM #49496
BrendanKeymasterHi Pavel,
Try removing that field from your custom layout and drag it back in again.
Maybe something is messed up with that specific field on your custom layout. Don’t delete the field from the Fields list of course. Just remove it from the custom layout and add it back.
Thanks,
Brendan
May 29, 2023 at 1:19 PM #49497
BrendanKeymasterAlso, you can have a Script Field just return its data and display it on a custom layout. You don’t have to set another field with the result just to display the result.
May 30, 2023 at 1:13 PM #49506
PavelParticipantHi Brendan,
I have this problem generally. Delete and replace field in layout is without effect.
Maybe I make some stupid mistake. Simply script is here:function Fill_Match() {
var ar_lv_r1_id = ‘fld-19384a3f4f1248ea82b16a9d4eee55e0’;
var ar_lv_r2_id = ‘fld-68464406010642928be2d4722d5b73fa’;
var ar_lv_r3_id = ‘fld-a09de8a68b6a4658bb030c677341a670’;
var ar_hv_r1_id = ‘fld-15db9eb1f8be4797a7f787ee90d40d04’;
var ar_hv_r2_id = ‘fld-47295e7cae1a46d6935848285ba24c82’;
var ar_hv_r3_id = ‘fld-37dc77cbaf2941a285c76be51f14fa03’;record.setFieldValue(ar_lv_r2_id, ‘XXXX’);
record.saveAllChanges;
console.log(record.getFieldValue(ar_lv_r2_id));
return;}
Fill_Match();
May 30, 2023 at 3:28 PM #49507
Daniel LeuParticipantUse either
form.saveAllChanges();
ordocument.saveAllChanges();
.May 31, 2023 at 6:16 AM #49510
PavelParticipantI tried all in the past but without effect
May 31, 2023 at 7:45 AM #49511
Daniel LeuParticipantHmmm… this works for me:
function Fill_Match() { var ar_lv_r1_id = 'fld-fceb89a0a96345e18d7f06d4991296a6'; var ar_lv_r2_id = 'fld-fceb89a0a96345e18d7f06d4991296a6'; var ar_lv_r3_id = 'fld-fceb89a0a96345e18d7f06d4991296a6'; var ar_hv_r1_id = 'fld-fceb89a0a96345e18d7f06d4991296a6'; var ar_hv_r2_id = 'fld-fceb89a0a96345e18d7f06d4991296a6'; var ar_hv_r3_id = 'fld-fceb89a0a96345e18d7f06d4991296a6'; console.log("Before: " + record.getFieldValue(ar_lv_r2_id)); record.setFieldValue(ar_lv_r2_id, 'XXXX'); document.saveAllChanges(); console.log("After: " + record.getFieldValue(ar_lv_r2_id)); return; } Fill_Match();
With the console log:
5/31/23, 7:44:24 AM / New Form / testing Fill_Match Before: XXXXY After: XXXX
May 31, 2023 at 11:17 AM #49518
BrendanKeymasterAs Daniel mentioned, there’s no
record.saveAllChanges
property or function. Also, without the()
, that would be a property and not a function. -
AuthorPosts
You must be logged in to reply to this topic.