Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Change function for a Calculated VL field to populate a Date field

Anonymous
Not applicable

I've tried several snippets of code for a Custom Object, but I keep getting a property error on id in the $('div line and the error is popping at the Dropdown button code when I look at the error.

The end goal is to update the Date field if the calculated field changes.  DDEs won't work as the calculation good stay the same even if the underlying fields were changed.

<script type="text/javascript">
var StatusFld = 19670;
var StatusDate = 26427;
var currentDate = new Date();

Sys.Application.add_load(function() {
$('div[id*="f' + StatusFld + 'c"]').change(function() {
console.log("Field has changed");
$CM.setFieldValue(StatusDate , currentDate, '');
});
});
</script>

1 ACCEPTED SOLUTION

Accepted Solutions

DavidPetty
Archer Employee
Archer Employee

@Anonymous, calculations are done on the server side and the browser events would never trigger being what's being sent back to the browser refreshed data.

 

 Advisory Consultant

View solution in original post

2 REPLIES 2

DavidPetty
Archer Employee
Archer Employee

@Anonymous, calculations are done on the server side and the browser events would never trigger being what's being sent back to the browser refreshed data.

 

 Advisory Consultant

Anonymous
Not applicable

@DavidPetty Not what a I wanted to hear but at least I'm not going crazy (ier).  I'm trying to avoid having to have the standard 3 calc field history stack. This group also doesn't want me to use a data feed or AWF solution so those are off the table as well.