Home › Forums › vLooup for SharePoint › Sum action in vLookups › Reply To: Sum action in vLookups
January 5, 2016 at 15:38
#9757
No worries. I appreciate you taking the time to answer our little questions.
This is the code I’m currently using (I’ve commented out the rest until I can get the Subtotal working). I’ve grabbed the field internal name from the child list for Line Total (Line_x0020_Total) and used the field internal name for the vLookup (vLookup) field in the parent. Is this correct? When the function is triggered it empties the Subtotal field.
fields = init_fields_v2(); function CalcTotal() { var vLookupTotal = $(".vLookup_Line_x0020_Total_vLookup").text(); //var Subtotal = getFieldValue('Subtotal'); //var Tax = getFieldValue('Sales_x0020_Tax'); //var Prod = ((Subtotal*Tax)/100); //var TotalCalc = (+Prod + +Subtotal); setFieldValue('Subtotal',vLookupTotal); //setFieldValue('Total',TotalCalc); }