Error When Copying Decimal Values
I have an odd problem in a solution of mine --- I have a custom BO which is used to create customer invoice requests (CIRs) using some values taken from a record of another custom BO. During the AfterModify script which creates this CIR (an XML file input is used to trigger the script), I try to copy some data from fields in the single record of the second custom BO, into matching fields I've put in an XBO for CIR. The odd thing is that the script just stops as soon as it tries to parse the lines which copy the values --- no error message that I can see of any kind. If the fields I'm writing to were read-only it'd say so when I tried to activate the AfterModify script I think. Can anyone shed some light on this?
You'll notice I'm using 'instCustomerInvoiceRequest', which as you can see is the name of the newly-created CIR instance. I also tried putting the same functional code, but using 'elementsofCIRRoot' pre-creation of the CIR.
Horst Schaude replied
In the Extension BO you can annotate the DecimalValue data type with "Decimal"
[Decimal (15,3)] element MyDecValue : DecimalValue;
This element has a total of 15 digits with 3 digits after the decimal point
The maximum range is 29 digits, 14 for the fraction.
If you omit the annotation the standard is used, i.e. 7 digits at all, 2 digits for the fraction
In the Customer Business Object you cannot annotate this data type.
Here the maximum is used.
I assume in your case a value larger than 7 digits is in the element of the CBO HostBilling, but the element in the Extension BO CustomerInvoiceRequest can not host that large value => Dump
- Annotate in the Extension BO CustomerInvoiceRequest the element with [Decimal(29,14]) to match the data type definition of the Customer BO HostBilling
- Make sure that the values in the CBO does not exceed 7 digits.