Using this script
//If the DSR namespace object is not defined, create it.
if (typeof (DSR) == "undefined")
{ DSR = {}; }
// Create Namespace container for functions in this library;
DSR.Main = {
Form_onload: function () {
},
Form_onsave: function (context) {
},
// Hook this function to onchange of customerid
Form_onchange: function () { // Notice difference between TAB and SHIFT+TAB, for onchange bug
if (Xrm.Page.getAttribute("customerid") != null) {
var tempvalue = Xrm.Page.getAttribute("customerid").getValue();
if (tempvalue != null) {
Xrm.Page.getAttribute("activeon").setValue(new Date());
} else {
Xrm.Page.getAttribute("activeon").setValue(null);
}
}
}
};
... and hiding the "serviceaddress" field on the form (so "activeon" immediately follows "customerid"), the value in activeon WILL be set on putting in a customer and doing TAB (into the next field which now happens to be the date field), but if you leave the date field the value immediately goes away. It ONLY happens with date fields and only if it is the field you enter (so if you do Shift+TAB and move upwards into a different field than "activeon", you do not have the problem).
Is there a fix for this anywhere? Because losing dates in a form without noticing (it does so on close+save as well) is quite a problem, as we have a lot of forms where we set a date field depending on the activity done to the previous field.
We run CRM 365 without autosave.
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (