Page 1 of 1
Getting field value before update record
Posted: Wed Nov 15, 2023 8:41 am
by christ2000
Hello, i am using the following code to try to get both values, first the old field value and the same new field value before update my dropdown field:
// Assume this is your initial capture, perhaps on page load or some initialization
var currentVisibleText2014 = $("#x_Providersh2014 option:selected").text();
// Event handler for when the dropdown changes, for example, on change event
$("#x_Providersh2014").on("change", function () {
// Update the variable when the dropdown changes
currentVisibleText2014 = $(this).find(":selected").text();
console.log("Updated Visible Text 2014:", currentVisibleText2014);
});
my problem is i don't get the new value input on the dropdown field(before save the record), just the old one, can some one check this?
thanks
Re: Getting field value before update record
Posted: Wed Nov 15, 2023 9:01 am
by mobhar
Why don't you use Row_Updating server event by optimizing the $rsold
and $rsnew
objects?
Re: Getting field value before update record
Posted: Wed Nov 15, 2023 9:32 am
by christ2000
hello the problem i am still trying to setup tinymce templates, so i need work with client scripts, my tiny code look as:
title: 'Change of Staff',
description: 'This is email for Change of Staff.',
content: `<p class="MsoNormal"><span style="font-family: 'Calibri Light', sans-serif;">Hello Staff,</span></p>
<p class="MsoNormal"><span style="font-family: 'Calibri Light', sans-serif;">Please find below the change of staff:</span><span style="font-family: 'Calibri Light', sans-serif;"> </span></p>
<p class="MsoNormal"><span lang="es-us" style="font-family: 'Calibri Light', sans-serif;" xml:lang="es-us">Client:</span><strong><span lang="es-us" style="font-family: 'Calibri Light', sans-serif;" xml:lang="es-us"> ${$("#x_Name").val()} ${$("#x_LastName").val()}<br></span></strong></p>
<p class="MsoNormal"><span style="font-family: 'Calibri Light', sans-serif;">Previous RBT: <strong>${oldDropdownValue2014}</strong></span></p>
<p class="MsoNormal"><span style="font-family: 'Calibri Light', sans-serif;">New RBT: <strong>${updatedDropdownText2014}</strong></span></p>
<p class="MsoNormal"><span style="font-family: 'Calibri Light', sans-serif;">Effective: <span style="background-color: rgb(241, 196, 15);"><strong>05/17/2023</strong></span></span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>`
}
];
Re: Getting field value before update record
Posted: Wed Nov 15, 2023 9:34 am
by christ2000
the old value work perfect, the problem is on my tinymce template i need to show the old and new values on this record, so the i dont have sucess getting the old value on the dropdown field before save and put on the template. my template must look as:
Hello Staff,
Please find below the change of staff:
Client: Maria Perez
Previous RBT: Peter Tom
New RBT: Robert Wilson
Effective: 05/17/2023
Re: Getting field value before update record
Posted: Wed Nov 15, 2023 9:58 am
by arbei
If the field is a lookup field, you may see Retrieving selections.
Re: Getting field value before update record
Posted: Wed Nov 15, 2023 10:14 am
by christ2000
Yes it is a lookup field, let me check that, thanks