Customization and programming tricks by Ronny Van der Snickt

Error on quote product: Precision must be an integer…

Had the following error when selecting a product on a quote detail form.

Precision must be an integer within the allowed range: 0 for integers, 0 to 4 for money, 0 to 10 for decimal, and 0 to 5 for float fields.

I first checked this.
http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/8e02cea2-bef8-45d8-b67a-6cb360ad8f2c

But the selected item was already configured in the selected pricelist.

After comparing the export xml of the customer organization with an export xml of a clean organization, I found out there was a missing ‘Internal Handler’ on the onload

<event name=onload“ application=true“ active=true>
    <InternalHandlers>
        <Handler 
functionName=Mscrm.Form_onload“ libraryName=QuoteDetail_main_system_library.js“ handlerUniqueId=eea0b1f7-ed51-4231-a5f7-c109c3d1f0de“ enabled=true>
            <dependencies>
                <dependency id=quantity />
                <dependency id=productid />
                <dependency id=uomid />
                <dependency id=isproductoverridden />
                <dependency id=productdescription />
                <dependency id=ispriceoverridden />
                <dependency id=priceperunit />
                <dependency id=willcall />
            </dependencies>
        </Handler>
    </InternalHandlers>
</event>

I cut and past the event handler, imported the solution and published the imported customizations. Now everything works perfect again.

Here is the location of the ‘internal Handler event’ in the customizations.xml file.
Note that we already had a custom onload function configured.
xmlExample

Disclaimer: The following information was not released or documented by Microsoft. So be careful and backup your system. Before trying this.

Comments

Comment from Josh
Time: April 8, 2013, 4:32 pm

Great article!

We’ve been looking for a fix for this problem for a few weeks now, and changing the price list wasn’t the solution. I’m very interested to test the changes to the customizations.xml file like you stated, but my knowledge of CRM 2011 is limited. How do you access the customizations.xml file? How do you get the export of the organization? Thanks for the help!

Comment from admin
Time: April 9, 2013, 8:37 am

Create a new solution and add the quote product entity into the solution. Export this as unmanaged. You wil get a zip file, extract it and it wil contain a customizations.xml. This is the XML you have to modify. Change it and put in back into the zip. Import this and publish your customization.

Don’t forget to backup your DB first:-)

Comment from Emma
Time: April 9, 2013, 11:13 pm

I am looking for a solution for a week now. Thanks for your article! My question is similar to Josh’s: I exported Quote Product from the vanilla organization but it does not have anything like the customized one, it is almost empty. So can I just add your section to my customizations.xml file and import it? Also, we are getting the same pop-up message in Order Products and I am not sure where I can get the InternalHander code for it from. Please let me know. Thanks a lot!

Comment from admin
Time: April 10, 2013, 8:40 am

I forgot to mention that, I had to change the form (I added the created on in the header) in the clean organization. Then if you export the entity you will see the complete formxml in the customizations. Including the internal events.

Comment from Emma
Time: April 10, 2013, 8:34 pm

Thanks a lot for your comment. I followed your instructions and there is no pop-up message anymore!! The only problem left is that a small percentage of the Order Products have practically all fields (such as Existing Product, Write-In, etc.) disabled. The Orders are active and there is no JScript to disable them so I cannot understand why. If by any chance you know the answer, please let me know. Thanks again!

Comment from Josh
Time: April 11, 2013, 1:40 pm

Emma, what did you change in your customizations.xml file? I’m curious because I cannot find anything missing from mine.

Admin, we have also customized a few parts in our Entities. Our onload event contains the functionName=”Form.onload” and is part of an event that has (similar to yours in the picture in the original post). If I’m reading the Technet documentation correctly, this shouldn’t matter as is just a global version of . My guess is that because we have the global handler, we don’t need the “Mscrm.” in front of our functionName. That being said, our onload event for the Opportunity Product form (which is where we encounter the error) is turned off (application=”false” active=”false”), and also the handler previously mentioned is not enabled (enabled=”false”). We do not get the error when we open the form, only when we change certain fields on the form.

Comment from Josh
Time: April 11, 2013, 2:27 pm

Sorry for the double post, but I figured I should add some good news. After stumbling around all this code for CRM, it finally clicked. I was able to follow your steps (in the post and in the commets), plus Emma’s comments and compare a vanilla to our dev cuustomizations.xml file. I copied the vanilla onload event over to ours, did a DB backup, imported the solution and published the customizations. The error shows up no more! Now I have to test what part of the onload event is incorrect, but I am still extremely happy that the error is gone. Thank you both for so much help and insight! We really appreciate it!

Comment from Emma
Time: April 11, 2013, 5:15 pm

I think I figured out why fields were disabled in the Order Product. I believe it happens if an Order was created from Quote or Opportunity. So we are OK now. Thanks again for your post! It was the only one in the entire internet that was exactly to the point!

Comment from Steven Rasmussen
Time: June 13, 2013, 10:29 pm

Just wanted to say “Thanks”! This worked for us as well. It was really pretty annoying.

Write a comment