Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 137182

Forum Post: Error message on calculated fields.

$
0
0

Hello,

I'm trying to calculate the amount of days past a due date an invoice is. I'm current getting an error of "Object does not support this action." I currently have it set up as an onchange event. Here's the javascript I'm trying to use.

function new_invoiceaging_onchange(){

var d = new Date()

var currentday = new Math.abs(d.getDate())

var currentyear = new Math.abs(d.getFullYear())

var currentmonth = new Math.abs(d.getmonth())

var startday = Math.abs(crmForm.all.duedate.getDate())

var startyear = Math.abs(crmForm.all.duedate.getFullYear())

var startmonth = Math.abs(crmForm.all.duedate.getmonth());

crmForm.all.new_invoiceaging.datavalue = (currentyear - startyear)*365 + (currentmonth - startmonth)*30 + (currentday - startday)*1

crmForm.all.new_financechargeestcalculationdate.dataValue = (currentyeara - startyeara)*0.015 + (currentmontha - startmontha)*0.015/12 + (currentdaya - startdaya)*0.015/365;

}

 


Viewing all articles
Browse latest Browse all 137182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>