Add values to total price
-
giovedì 4 settembre 2008 20:36
Dear All
I add new fields to Quote product view and I want the value of this fields to be added to total amount
var totalprice = crmForm.all.totalprice.DataValue;
var value1 = crmForm.all.new_value1.DataValue;
var value2 = crmForm.all.new_value2.DataValue;
totalprice = totalprice + value1 + value2;
I want to know if this code is right or not and also I want to know how can I set this value to "total amout" textbox in Quote Product view.
Thanks in advance
Tutte le risposte
-
venerdì 5 settembre 2008 09:38
Code seems right, but when you are saying "total amount" textbox, are you referring to the total amount text box of "Quote" Entity (page) or of "Quote Product" page?
-
venerdì 5 settembre 2008 11:00Moderatore
There is no totalamount on the quote product. Do you mean extended amount?
If you mean fields on the quote record, then there is a totalprice attribute.
if you are setting the value of the totalprice field, the last line should be
crmForm.all.totalprice.DataValue=totalprice + value1 + value2;
Some other things to consider:
1. The extended amt is readonly on the form. Typically with read only fields, you can use forcesubmit in your javascript to force update of a read only field; however, this attribute is set to read only by the system, and I believe that you cannot change it
2. This filed has some processes that run upon save to calculate the extended price less discounts x qty. Even if you could update the extended price field, your change would probably get overwritten by the calculated value.
Best thing is probably find a way to encorporate your new values into the other values in the quote product form, or create new write-in quote products for these items.
- Contrassegnato come risposta DavidJennawayMVP, Moderator sabato 2 maggio 2009 07:17
-
mercoledì 10 settembre 2008 13:30
Dir sir
I try this code to change the value in tax field in onsave event in form
var tax = crmForm.all.tax.DataValue;
var value1 = crmForm.all.new_value1.DataValue;
var value2 = crmForm.all.new_value2.DataValue;
crmForm.all.tax.DataValue=tax+ value1 + value2;
but also it does not work
I try to create workflow for this but their is no quote product to design workflow for it
Can you help me