Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Error when Calculating Price Manullay

Posted on by Microsoft Employee

Hi

I have followed the article "Sample: Calculate Price plug-in" for quote entity, but I get following error when the code wants to update tax and total amount: 

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Incorrect attribute value type System.Int32Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220989</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Incorrect attribute value type System.Int32</Message>
<Timestamp>2017-01-16T19:51:59.932836Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>

[TaxCalculator: TaxCalculator.CalculatePricePlugin]
[4b8695e5-20dc-e611-93f6-000c29609d80: TaxCalculator.CalculatePricePlugin: CalculatePrice of quote]


[Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.TargetAttributeValidationPlugin]
[fc743e7d-fbea-4695-bdb9-7d78334c8474: TargetAttributeValidationPlugin]

</TraceText>
</OrganizationServiceFault>

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error when Calculating Price Manullay

    I dont use any optionset in my code. please refer to the mentioned article in my question.

  • Suggested answer
    Neil Benson Profile Picture
    Neil Benson 7,367 User Group Leader on at
    RE: Error when Calculating Price Manullay

    The error message is: "Incorrect attribute value type". An internet search on that error will show you how to resolve it: stackoverflow.com/.../incorrect-attribute-value-type-microsoft-xrm-sdk-optionsetvalue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans