Calculating additional fields on a Quote Form - 179282

Hi there,

I have this percentage custom field I convert into a money field using 
javascript which is added to the detail amount. I then calculate the tax in 
order to get a total amount. The problem is when i use the below script, when 
I save twice the correct total amount appears, but when I save and close a 
totally different total amount appears

SCRIPT

function OnSave()
{
crmForm.all.totalamountlessfreight.DataValue = 
(crmForm.all.totallineitemamount.DataValue / 100) * 
crmForm.all.discountpercentage.DataValue + 
crmForm.all.totallineitemamount.DataValue;

crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue + 
crmForm.all.totalamountlessfreight.DataValue;

Any suggestions would be highly appreciated.
0
Utf
9/13/2007 2:22:08 PM
crm 35858 articles. 1 followers. Follow

6 Replies
565 Views

Similar Articles

[PageSpeed] 26

Every time you save the record this will keep adding tot he TotalTax field 
(totaltax = totaltax + totalamountlessfreight).  No where are you actually 
calculating a tasx amount as you never reference a tax percentage.

-- 

Matt Parks
MVP - Dynamics CRM


"Lebo" <Lebo@discussions.microsoft.com> wrote in message 
news:B756A268-3E92-4347-A6AA-C5B09CFB50BF@microsoft.com...
Hi there,

I have this percentage custom field I convert into a money field using
javascript which is added to the detail amount. I then calculate the tax in
order to get a total amount. The problem is when i use the below script, 
when
I save twice the correct total amount appears, but when I save and close a
totally different total amount appears

SCRIPT

function OnSave()
{
crmForm.all.totalamountlessfreight.DataValue =
(crmForm.all.totallineitemamount.DataValue / 100) *
crmForm.all.discountpercentage.DataValue +
crmForm.all.totallineitemamount.DataValue;

crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue +
crmForm.all.totalamountlessfreight.DataValue;

Any suggestions would be highly appreciated. 


0
Matt
9/13/2007 2:52:19 PM
The Total Amount field (if I'm not mistaken) will always be overridden with 
CRM's built-in Calcualtions. 

"Lebo" wrote:

> Hi there,
> 
> I have this percentage custom field I convert into a money field using 
> javascript which is added to the detail amount. I then calculate the tax in 
> order to get a total amount. The problem is when i use the below script, when 
> I save twice the correct total amount appears, but when I save and close a 
> totally different total amount appears
> 
> SCRIPT
> 
> function OnSave()
> {
> crmForm.all.totalamountlessfreight.DataValue = 
> (crmForm.all.totallineitemamount.DataValue / 100) * 
> crmForm.all.discountpercentage.DataValue + 
> crmForm.all.totallineitemamount.DataValue;
> 
> crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue + 
> crmForm.all.totalamountlessfreight.DataValue;
> 
> Any suggestions would be highly appreciated.
0
Utf
9/14/2007 3:34:00 AM
Thanx for the response Matt,
Please look at the below script ive included the tax calculation.
Is there any way where i could override the built calculations for the total 
amount?

function OnSave() 
{ 
crmForm.all.totalamountlessfreight.DataValue = 
(crmForm.all.totallineitemamount.DataValue / 100) * 
crmForm.all.discountpercentage.DataValue + 
crmForm.all.totallineitemamount.DataValue; 

CrmForm.all.totaltax.DataValue = 
crmForm.all.totalamountlessfreight.DataValue * 14 /100;   // Tax calculation

crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue + 
crmForm.all.totalamountlessfreight.DataValue; 



"Matt Parks" wrote:

> Every time you save the record this will keep adding tot he TotalTax field 
> (totaltax = totaltax + totalamountlessfreight).  No where are you actually 
> calculating a tasx amount as you never reference a tax percentage.
> 
> -- 
> 
> Matt Parks
> MVP - Dynamics CRM
> 
> 
> "Lebo" <Lebo@discussions.microsoft.com> wrote in message 
> news:B756A268-3E92-4347-A6AA-C5B09CFB50BF@microsoft.com...
> Hi there,
> 
> I have this percentage custom field I convert into a money field using
> javascript which is added to the detail amount. I then calculate the tax in
> order to get a total amount. The problem is when i use the below script, 
> when
> I save twice the correct total amount appears, but when I save and close a
> totally different total amount appears
> 
> SCRIPT
> 
> function OnSave()
> {
> crmForm.all.totalamountlessfreight.DataValue =
> (crmForm.all.totallineitemamount.DataValue / 100) *
> crmForm.all.discountpercentage.DataValue +
> crmForm.all.totallineitemamount.DataValue;
> 
> crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue +
> crmForm.all.totalamountlessfreight.DataValue;
> 
> Any suggestions would be highly appreciated. 
> 
> 
> 
0
Utf
9/14/2007 6:40:01 AM
Thanx for the response Matt,
Please look at the below script ive included the tax calculation.
Is there any way where i could override the built calculations for the total 
amount?

function OnSave() 
{ 
crmForm.all.totalamountlessfreight.DataValue = 
(crmForm.all.totallineitemamount.DataValue / 100) * 
crmForm.all.discountpercentage.DataValue + 
crmForm.all.totallineitemamount.DataValue; 

CrmForm.all.totaltax.DataValue = 
crmForm.all.totalamountlessfreight.DataValue * 14 /100;   // Tax calculation

crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue + 
crmForm.all.totalamountlessfreight.DataValue; 



"Matt Parks" wrote:

> Every time you save the record this will keep adding tot he TotalTax field 
> (totaltax = totaltax + totalamountlessfreight).  No where are you actually 
> calculating a tasx amount as you never reference a tax percentage.
> 
> -- 
> 
> Matt Parks
> MVP - Dynamics CRM
> 
> 
> "Lebo" <Lebo@discussions.microsoft.com> wrote in message 
> news:B756A268-3E92-4347-A6AA-C5B09CFB50BF@microsoft.com...
> Hi there,
> 
> I have this percentage custom field I convert into a money field using
> javascript which is added to the detail amount. I then calculate the tax in
> order to get a total amount. The problem is when i use the below script, 
> when
> I save twice the correct total amount appears, but when I save and close a
> totally different total amount appears
> 
> SCRIPT
> 
> function OnSave()
> {
> crmForm.all.totalamountlessfreight.DataValue =
> (crmForm.all.totallineitemamount.DataValue / 100) *
> crmForm.all.discountpercentage.DataValue +
> crmForm.all.totallineitemamount.DataValue;
> 
> crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue +
> crmForm.all.totalamountlessfreight.DataValue;
> 
> Any suggestions would be highly appreciated. 
> 
> 
> 
0
Utf
9/14/2007 6:40:02 AM
Hi Lebo,

the total fields for the quote are calculated by platform code (i.e. on the 
server) and cannot be overwritten on the client. The workaround that we use 
involves creating custom fields for totals and using these custom fields 
throughout the system, e.g. on printed quote, in reports, etc.

-- 
George Doubinski
CRM Certified Professional - Developer


"Lebo" <Lebo@discussions.microsoft.com> wrote in message 
news:B756A268-3E92-4347-A6AA-C5B09CFB50BF@microsoft.com...
> Hi there,
>
> I have this percentage custom field I convert into a money field using
> javascript which is added to the detail amount. I then calculate the tax 
> in
> order to get a total amount. The problem is when i use the below script, 
> when
> I save twice the correct total amount appears, but when I save and close a
> totally different total amount appears
>
> SCRIPT
>
> function OnSave()
> {
> crmForm.all.totalamountlessfreight.DataValue =
> (crmForm.all.totallineitemamount.DataValue / 100) *
> crmForm.all.discountpercentage.DataValue +
> crmForm.all.totallineitemamount.DataValue;
>
> crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue +
> crmForm.all.totalamountlessfreight.DataValue;
>
> Any suggestions would be highly appreciated. 


0
George
9/14/2007 8:52:28 AM
Not that I am aware of.

-- 

Matt Parks
MVP - Dynamics CRM


"Lebo" <Lebo@discussions.microsoft.com> wrote in message 
news:BB36FA22-0BCA-4FED-A1BF-75F127E5497A@microsoft.com...
Thanx for the response Matt,
Please look at the below script ive included the tax calculation.
Is there any way where i could override the built calculations for the total
amount?

function OnSave()
{
crmForm.all.totalamountlessfreight.DataValue =
(crmForm.all.totallineitemamount.DataValue / 100) *
crmForm.all.discountpercentage.DataValue +
crmForm.all.totallineitemamount.DataValue;

CrmForm.all.totaltax.DataValue =
crmForm.all.totalamountlessfreight.DataValue * 14 /100;   // Tax calculation

crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue +
crmForm.all.totalamountlessfreight.DataValue;



"Matt Parks" wrote:

> Every time you save the record this will keep adding tot he TotalTax field
> (totaltax = totaltax + totalamountlessfreight).  No where are you actually
> calculating a tasx amount as you never reference a tax percentage.
>
> -- 
>
> Matt Parks
> MVP - Dynamics CRM
>
>
> "Lebo" <Lebo@discussions.microsoft.com> wrote in message
> news:B756A268-3E92-4347-A6AA-C5B09CFB50BF@microsoft.com...
> Hi there,
>
> I have this percentage custom field I convert into a money field using
> javascript which is added to the detail amount. I then calculate the tax 
> in
> order to get a total amount. The problem is when i use the below script,
> when
> I save twice the correct total amount appears, but when I save and close a
> totally different total amount appears
>
> SCRIPT
>
> function OnSave()
> {
> crmForm.all.totalamountlessfreight.DataValue =
> (crmForm.all.totallineitemamount.DataValue / 100) *
> crmForm.all.discountpercentage.DataValue +
> crmForm.all.totallineitemamount.DataValue;
>
> crmForm.all.totaltax.DataValue = crmForm.all.totaltax.DataValue +
> crmForm.all.totalamountlessfreight.DataValue;
>
> Any suggestions would be highly appreciated.
>
>
> 


0
Matt
9/18/2007 4:33:38 PM
Reply:

Similar Artilces:

Calculating Taxes and Making calculations
Hello, Kindly plz tell me how do i go about making some small calculations based on my existing data such as how to compute taxes and do other calculations based on some quantitative data. where exactly do i make modifications on my application??? Kindly help me out. Thanks , swati you can add code in javascript behind dropdowns or piclist fields. One example might be a dropdown which has shipping options ie ups, fedex etc. When you choose one it takes the weight of your package (whcih you enter) then calculates a shipping cost. search the archives of this group at groups.google.com and ...

Procedure to calculate distance using latitude/longitude
Does anyone know of a vba procedure for access that will calculate straightline distance using latitude and logitude for 2 points? AJ wrote: > Does anyone know of a vba procedure for access that will calculate > straightline distance using latitude and logitude for 2 points? See: http://groups.google.com/group/microsoft.public.access/msg/6b934b0e580b974b James A. Fortune MPAPoster@FortuneJames.com ...

How to get additional symbols
How or Where can I download additional symbols?? On the "insert Symbols" menu I have a fairly wide selection of alphabet letters and a few symbols. My partner has MS Works and has many more useful symbols than I have with Word 2003. I want to insert bold arrows, like then kind he has on Works. How or Where can I download additional symbols?? -- Jody The "symbols" are in the fonts that came with Windows and Word or Office. There's a Unicode range called "Arrows," but none of those are what I'd call bold; did you try the Wingdings font?...

IIF statement pulling from wrong field
I have a query have has the 5 variations of the following IIF statement: Bag Total: IIf(" " & [Unit of Measure] & " " Like "* BAG *",[Qty],Null) this statement says to add up if the unit of measure if it is a bag. I am attempting to add another IIF statement that says =Sum(IIf([product type] Like "*printed*", [pounds], 0)) - I am trying to add up if the product type has the word printed in it total it at each customer and at the end of the report. When I use this IIF statement on my report, it is totalling the amount from the printed IIf(...

How to calculate age of a person?
Hi, I'm struggling to figure this one out. I have a date column and I'd like to be able to calculate the age without doing it in my head. I've tried to do this but am struggling. Any help will greatly appreciated. Thanks Suzanne Visit www.cpearson.com and search for DATEDIFF best wishes -- Bernard V Liengme Microsoft Excel MVP www.stfx.ca/people/bliengme remove caps from email "Grd" <Grd@discussions.microsoft.com> wrote in message news:6BFFD11C-AECB-4837-93B6-D84B6170B975@microsoft.com... > Hi, > > I'm struggling to figure this one out. I have...

Form Fields
I have created a form for use by others. I used the Text form fields format when creating the form, my problem is the main text in the form does not stay locked in place. When we try to type to fill in the form fields it moves the main body text. I have tried using the Document Protection tab and telling it to allow formatting only in the form fields but that still does not prevent the other text from moving. I did this in word 2007. Any idea on what to do to lock the main body in to allow filling in just the Form fields. Hi Michael, The simplest way to gain control over the ...

"Program trying to access e-mail addresses" msg
Hi. I recently installed SP3 on my computer, and now I get an odd message when I open emails. A box pops up that says, "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose 'No'." My virus scan turned up nothing, and the "detect & repair" function of Outlook did not change this. Anyone have any idea what's going on? Thanks! Same here. After "yes" or "no" outlook stop responding. Curious to find an answer! Mel &...

EXCEL 2007 Formula to calculate INTEREST only on a 3 month bridge
I am trying to calculate monthly INTEREST ONLY payment on a short term bridge/swing loan. Assuming an interest rate of 2.75%, paid monthly, Also assuming it will be required for a 3-6 month period, amount approx $500,000. Just switched to Excel 2007 but don't seem to be able to calculate using the formula builder. Not sure if it is compounded daily or monthly. You might want to check out the IPMT function. From the XL help file: IPMT(rate,per,nper,pv,fv,type) Rate is the interest rate per period. Per is the period for which you want to find the interest and must...

MS2004 and Outlook Contacts "Sync"
Just purchased my 2004 DB version hoping (still hopeful after two previous releases) that there might be some Outlook Contact and Money Contact relationships established in the "synchronization". Disappointed to find that all I got in 2003 was a cheesy PAB-type Contact book and no way to associate or link the invoices to my Money/Outlook Contact. Question: Is there a way to single out the invoices in the 2003 or 2004 Money program Database so that I can save in the Outlook's contact body or even in a folder in Windows Explorer? ...

Due Date Calculated
I need assistance on an expression that allows for the due date of recurring training to be one year from date completed. Details are as follows: I have a form named [frmTRNComplete] based on table named [tblTRNComplete] Form controls are: TRNID (combo box), DateComp (Text Box) , DateNext (text box), Reccuring (check box) I would like the DateNext to be 1 year from DateComp if Reccuring is true and Date next to be blank if Reccuring is false. -- Aloha, Ron A. Ron I'll assume that you want to use the form to calculate the DateNext, and that you are not trying to s...

Does not open documents saved in "My Documents"
I have Publisher 2003 on my computer. I cannot open the files I have stored in my documents all generated on 2003. I get a message stating "Cannot open files from different version." They were all written on the same version. Jimbwall-editor wrote: > I have Publisher 2003 on my computer. I cannot open the > files I have stored in my documents all generated on > 2003. I get a message stating "Cannot open files from > different version." They were all written on the same > version. ================================= Maybe the following article would o...

Where can I download additional typestyles?
I am looking for Century MT condensed extra bold, which was available in previous versions of Publisher but is not in the 2003 version. According to this site http://www.microsoft.com/typography/fonts/default.aspx your font was never included in a Microsoft Office product. Century Bold, but not condensed extra bold. Might ask on alt.binaries.fonts or do a search. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Weir" <Weir@discussions.microsoft.com> wrote in message news:6889D4C3-5648-45D0-86A7-083C6DFBF0CF@microsof...

how to calculate outliers
Google is your friend: http://www.google.com/search?q=calculate+outliers - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "ismhs" <ismhs@discussions.microsoft.com> wrote in message news:035124A0-06FA-4153-932E-6C4E0614F38C@microsoft.com... > ...

Calculated field options???
Here's my Data: Country Status --------- ---------- Canada Green Canada Blue Canada Green Canada Green Canada Blue In my pivot table, 'Country' is an item, and 'Status' is my only data field. What I really need to show in my data area is two column of data, one for 'Green' and one for 'Blue'. I tried creating two 'Calculated' fields with the following formulas, but they don't seem to be working: 'CalculatedField1' = IF((STATUS="Green"),1,0) 'CalculatedF...

Dynamics 4.0 slow to retrieve data when custom fields / lookups us
We've have this issue whereby if a custom field, say on the contact, is indexed, when you use advanced find, it seems to use the index. The response is acceptable. It appears however it you use the standard search bar and try the lookup, it appears that table scans are happening. Can anyone advise if we're reading the situation correctly and whether there is a way to speed up to normal search. Thanks -- C ...

Time Sheet Function to Calculate
I am having some trouble trying to establish a formula that will give me the number of hours worked during the day given the start time say 8.30am with an end time of 5.30pm and say 30 minutes for lunch. For this scenario, total working hours would be eight and a half hours but I need Excel to display this result as 8.30 hours (0.30 being the minutes in the half hour) and not 8.50. Can someone suggest what to do? Typically the layout would be Column A - Start Time say 8.30am Column B - Time in minutes spent at lunch say 30 minutes Column C - End Time say 5.30pm. Column D - the calculati...

How Do I Create A Fill In The Blanks Form
I created an application in MSO 2007 for porspective employees which I send via E-mail. When they finish completing the application & try to resend it, it comes back to me blank. Now I am trying to create the same document in Publisher but can not figure out how to set it up as a fill in the blanks form. Hope this makes sense??? Thank You I would strongly advice you agains using Publisher for that task. I love Publisher but not many people have access to it. You'd be better off creating your form with Word, or if you insist on using Publisher for the layout, convert it to ...

Making one field bold in a concatanated string
This issue is in MS Access 2003 I have a string with the last name and first name fields concatanated. I would like to bold the last name field only. Is there anyway to do this? The standard text box in Access 2003 and earlier cannot do that. Stephen Lebans has a solution here: http://www.lebans.com/mixbold-plain.htm -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "abnewallo" <abnewallo@discussions.microsoft.com> wrote in message news:519C584...

tenure calculations
how can I format several dates such as 04/19/2003, 04/01/2004, etc. int a yearly average for the employee tenure -- Message posted from http://www.ExcelForum.com right now say I have my yearly figures in i1-i9. The formula I though would work is =today()-average(i1:i9), but how would i format this to give me yearly read out -- Message posted from http://www.ExcelForum.com Hi djackson! One way is to use YEARFRAC with a third argument of 1 to get your tenures in years and fractions of a year and then average the result. However YEARFRAC does produce some annoying but small errors. Y...

Formula to calculate time
I was wondering if anybody knows of a formula to allow you to do calculations based on time. In other words, say I want to put a list of songs on a CD and their durations. Then, I want to add up the durations to get the full time of the CD, or my specific play list. So for example, using the information below: Ghostbusters - Ray Parker Jr. --- 5:23 (Just a guess) Phantom of the Opera Overture --- 3:55 (Another guess) Instead of 8:78, I'd want to see 9:18 Can this be done? Any help would be greatly appreciated. Thank you! -- Have a nice day! ~Paul Express Scripts, Charting the futu...

Advanced views.."By Conversation". Is it possible to have a view where I see only the first Item of a conversation?
Hi, I receive emails from a distribution list. I have set a "Search Folder"(outlook 2003) for these emails that allow me to view items arranged by Conversation. I need to create a view that will allow me to see Only the first items in a conversation.By viewing that conversation I should be able to decide whether or not I need to expand that group and read later emails in that thread. If I decide not to follow up on that conversation, I should be able to delete it and not have items from that conversation visible. This sounds challenging but I'm sure that the Outlook experts ...

Form Controls
Is there any way to make the group box borders invisible? I see a setting to not print, but I dont want them visible on scree either. I am using Excel 2002 SP2 Thanks in advance -- Message posted from http://www.ExcelForum.com I don't think you can do this except via code. Hit alt-f11 to get to the VBE hit ctrl-G to see the immediate window type this in and hit enter: activesheet.groupboxes.visible = false This hides all the groupboxes on the activesheet. "MaryM <" wrote: > > Is there any way to make the group box borders invisible? > I see a setting to n...

Insert calculated median field in pivottable
Anyone know how to get a median calculation in a pivot table? I've tried inserting a calculated field but it always sums the calculated field. Thanks, Joel Not supported in a pivot -- Regards, Peo Sjoblom (No private emails please) "Joel Schaefer" <joel@disintegrators.com> wrote in message news:ev4P0Nk6FHA.2616@TK2MSFTNGP15.phx.gbl... > Anyone know how to get a median calculation in a pivot table? I've tried > inserting a calculated field but it always sums the calculated field. > > Thanks, > > Joel > ...

regarding form preparation
i am designing a form in excel. i want only maximum one character/letter to be entered in a particular cell and once it is entered, cursor/active cell shifts to adjacent cell. i tried data validation, it helps in restricting maximum text length to one but i am not able to shift cursor/active cell to adjacent cell. -- Sumit ------------------------------------------------------------------------ Sumit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29520 View this thread: http://www.excelforum.com/showthread.php?threadid=492207 ...

how to set the "main" pst in outlook
how to find the a .pst so that it is the "main" pst that gets opened every time i start outlook? Outlook version? -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "jlofgren" <jlofgren@discussions.microsoft.com> wrote in message news:CB501F68-87A8-407E-AC19-7D299D7942B8@microsoft.com... > how to find the a .pst so that it is the "main" pst that gets opened every > time i start outlook? ...