Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Calculate difference between two fields

$
0
0

I have two fields one is the value of what it costs to hire a resource, the second is what we bill the client.  We want to know the margin or profit for this and sort by highest margin.  I have spent way to much time on something so simple and it wont work, in CRM 4.0 it was easy I must be doing something wrong.  

I have an onchange event that fires off when the billtoclient field is filled in.  

The equation is ClientBillRate -  ConsualtantBillRate  = Margin

//Margin Calculation
}
function Margin()
{
var BillLWG = crmForm.all.new_hourlyratebilledtolwg.Datavalue;
var BillClient = crmForm.all.new_hourlyratebilledtoclient.DataValue;
var Result = BillClient - BillLWG;

crmForm.all.new_margin.Datavalue = Result;

This isnt doing anything at all no errors but nothing works.  


Viewing all articles
Browse latest Browse all 8223

Trending Articles