Posted أغسطس 16, 2011
Adding GST Tax to Dynamics CRM 2011 Quote Products
One thing I find weird with Dynamics CRM 4.0 or Dynamics CRM 2011 is the quote product tax. Sure it is all there but it is not calculated automatically. If you have came across this previously then you know what I mean. It is a real pain to have to work out the Tax on a quote x amount of times per day. Shouldn't the system do this automatically. Well the answer is no.
So I decided to write a script to do this work for me. I figure if Dynamics CRM 2011 is managing my leads, opportunities and producing quotes using mail merge then it can work out my GST as well! Now as a developer I have gone the lazy way. I have written a small script to work out 10% of the Amount and simply plop it in the Tax field. Dynamics CRM 2011 takes care of the rest. By all means I could have written a script that has options for tax free products and services, however this was not necessary for our organisation. 99.99% of the time our quotes have 10% GST.
So this is how I did it.
Under Settings > Customisation > Web Resources I added a new Web Resource with the type of Script and called it Product Quote.
In that resource I added the following JavaScript by using the text editor.
And saved. I then found the entity I wanted to add my script to (in this case Quote Product) and then opened the form and selected Form Properties.
Within form properties I need to do a few things. Firstly I added my newly build Web Resource to the form library and then added the function to the Event Handler.
I then selected the control (Form) and the event (OnSave) and added my Library and entered the name of my JavaScript function.
I
Finally publish all your customisations from the Customise screen and your done.
Dynamics now calculates the GST on a Quote Product when you save your page. Simple, crude and effective!
If you need a hand with other Dynamics CRM 4.0 or Dynamics CRM 2011 features let us know. We would love to help.