Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Tax Quote Product

$
0
0

I am looking at making the Tax field in Quote Product to auto fill in with 20% of the amount.

How is it best to do this on a Existing product and Write-in line, I have had a look at some 3rd party solutions but I only require a basic VAT calculation in the taxes field.

Would I be able to write a plugin to Quote Product to work this out and to run on Update/Create?

As I have had a quick look and I am unable to see this entity in the list when adding the plugin.

here is the code that I have created

         if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
            {

                //create entity context
                Entity entity = (Entity)context.InputParameters["Target"];

                Money rate = (Money)entity.Attributes["baseamount"];

                //Multiply
                Money total = new Money(rate.Value * new decimal(0.20));

                //Set the update entity
                entity.Attributes["tax"] = total;

                //Update
                service.Update(entity);


Thanks


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>