Tuesday, January 26, 2010

Both 'amount' and 'percentage' cannot be set

There was a bit of learning involved last week when I was trying to update the Contract Line entity programmatically. I had a custom entity under the Contract Line entity. I had written web service code which inturn called the CRM Service to update the Contract Line entity with values from the custom child entity.

In my custom web service I was summing up the values from the child records and updating the 'Amount' and 'Discount Percentage' fields of the related Contract Line record.

While I was testing, the system generated the platform trace which said -

Both 'amount' and 'percentage' cannot be set.

I am assuming, CRM wanted to convey that both 'Amount' and 'Discount Percentage' fields of Contract Line entity cannot be calculated and updated using the CRM Service Update method.

I really don't know why was the system designed this way? All I do know is that I have to look for another way out.

I would appreciate if someone can reason this behavior!!